Package list libcryptx-perl / 5e6f4cc
New upstream version 0.066 gregor herrmann 1 year, 11 months ago
200 changed file(s) with 3201 addition(s) and 811 deletion(s). Raw diff Collapse all Expand all
00 Changes for CryptX
1
2 0.066 2019-10-20
3 - fix #57 Build fails on i686
4 - bundled libtomcrypt update branch:develop (commit:354c9051 2019-10-20)
5 - no perl module code change
6
7 0.065 2019-10-19
8 - fix #56 Math::BigInt 1.999817 breaks the tests of CryptX
9 - bundled libtomcrypt update branch:develop (commit:25410c75 2019-10-17)
10 - no perl module code change, just tests
111
212 0.064 2019-06-14
313 - fix #50 libtommath patch - building on HP-UX 11.11 / PA-RISC
171171 src/ltc/ciphers/safer/saferp.c
172172 src/ltc/ciphers/serpent.c
173173 src/ltc/ciphers/skipjack.c
174 src/ltc/ciphers/tea.c
174175 src/ltc/ciphers/twofish/twofish.c
175176 src/ltc/ciphers/twofish/twofish_tab.c
176177 src/ltc/ciphers/xtea.c
316317 src/ltc/misc/base32/base32_encode.c
317318 src/ltc/misc/base64/base64_decode.c
318319 src/ltc/misc/base64/base64_encode.c
320 src/ltc/misc/bcrypt/bcrypt.c
319321 src/ltc/misc/burn_stack.c
320322 src/ltc/misc/compare_testvector.c
321323 src/ltc/misc/copy_or_zeromem.c
483485 src/ltc/pk/dsa/dsa_sign_hash.c
484486 src/ltc/pk/dsa/dsa_verify_hash.c
485487 src/ltc/pk/dsa/dsa_verify_key.c
488 src/ltc/pk/ec25519/ec25519_export.c
489 src/ltc/pk/ec25519/ec25519_import_pkcs8.c
490 src/ltc/pk/ec25519/tweetnacl.c
486491 src/ltc/pk/ecc/ecc.c
487492 src/ltc/pk/ecc/ecc_ansi_x963_export.c
488493 src/ltc/pk/ecc/ecc_ansi_x963_import.c
521526 src/ltc/pk/ecc/ltc_ecc_projective_add_point.c
522527 src/ltc/pk/ecc/ltc_ecc_projective_dbl_point.c
523528 src/ltc/pk/ecc/ltc_ecc_verify_key.c
529 src/ltc/pk/ed25519/ed25519_export.c
530 src/ltc/pk/ed25519/ed25519_import.c
531 src/ltc/pk/ed25519/ed25519_import_pkcs8.c
532 src/ltc/pk/ed25519/ed25519_import_x509.c
533 src/ltc/pk/ed25519/ed25519_make_key.c
534 src/ltc/pk/ed25519/ed25519_set_key.c
535 src/ltc/pk/ed25519/ed25519_sign.c
536 src/ltc/pk/ed25519/ed25519_verify.c
524537 src/ltc/pk/pkcs1/pkcs_1_i2osp.c
525538 src/ltc/pk/pkcs1/pkcs_1_mgf1.c
526539 src/ltc/pk/pkcs1/pkcs_1_oaep_decode.c
534547 src/ltc/pk/rsa/rsa_encrypt_key.c
535548 src/ltc/pk/rsa/rsa_export.c
536549 src/ltc/pk/rsa/rsa_exptmod.c
537 src/ltc/pk/rsa/rsa_free.c
538550 src/ltc/pk/rsa/rsa_get_size.c
539551 src/ltc/pk/rsa/rsa_import.c
540552 src/ltc/pk/rsa/rsa_import_pkcs8.c
541553 src/ltc/pk/rsa/rsa_import_x509.c
554 src/ltc/pk/rsa/rsa_key.c
542555 src/ltc/pk/rsa/rsa_make_key.c
543556 src/ltc/pk/rsa/rsa_set.c
544557 src/ltc/pk/rsa/rsa_sign_hash.c
545558 src/ltc/pk/rsa/rsa_sign_saltlen_get.c
546559 src/ltc/pk/rsa/rsa_verify_hash.c
560 src/ltc/pk/x25519/x25519_export.c
561 src/ltc/pk/x25519/x25519_import.c
562 src/ltc/pk/x25519/x25519_import_pkcs8.c
563 src/ltc/pk/x25519/x25519_import_x509.c
564 src/ltc/pk/x25519/x25519_make_key.c
565 src/ltc/pk/x25519/x25519_set_key.c
566 src/ltc/pk/x25519/x25519_shared_secret.c
547567 src/ltc/prngs/chacha20.c
548568 src/ltc/prngs/fortuna.c
549569 src/ltc/prngs/rc4.c
4444 "url" : "https://github.com/DCIT/perl-CryptX"
4545 }
4646 },
47 "version" : "0.064",
47 "version" : "0.066",
4848 "x_serialization_backend" : "JSON::PP version 2.94"
4949 }
2121 resources:
2222 bugtracker: https://github.com/DCIT/perl-CryptX/issues
2323 repository: https://github.com/DCIT/perl-CryptX
24 version: '0.064'
24 version: '0.066'
2525 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( ccm_encrypt_authenticate ccm_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( chacha20poly1305_encrypt_authenticate chacha20poly1305_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( eax_encrypt_authenticate eax_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( gcm_encrypt_authenticate gcm_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( ocb_encrypt_authenticate ocb_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 ### not used
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::Checksum Exporter);
77 our %EXPORT_TAGS = ( all => [qw( adler32_data adler32_data_hex adler32_data_int adler32_file adler32_file_hex adler32_file_int )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::Checksum Exporter);
77 our %EXPORT_TAGS = ( all => [qw( crc32_data crc32_data_hex crc32_data_int crc32_file crc32_file_hex crc32_file_int )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw/ adler32_data adler32_data_hex adler32_data_int adler32_file adler32_file_hex adler32_file_int
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Cipher);
99
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_160 blake2b_160_hex blake2b_160_b64 blake2b_160_b64u blake2b_160_file blake2b_160_file_hex blake2b_160_file_b64 blake2b_160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_256 blake2b_256_hex blake2b_256_b64 blake2b_256_b64u blake2b_256_file blake2b_256_file_hex blake2b_256_file_b64 blake2b_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_384 blake2b_384_hex blake2b_384_b64 blake2b_384_b64u blake2b_384_file blake2b_384_file_hex blake2b_384_file_b64 blake2b_384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_512 blake2b_512_hex blake2b_512_b64 blake2b_512_b64u blake2b_512_file blake2b_512_file_hex blake2b_512_file_b64 blake2b_512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_128 blake2s_128_hex blake2s_128_b64 blake2s_128_b64u blake2s_128_file blake2s_128_file_hex blake2s_128_file_b64 blake2s_128_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_160 blake2s_160_hex blake2s_160_b64 blake2s_160_b64u blake2s_160_file blake2s_160_file_hex blake2s_160_file_b64 blake2s_160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_224 blake2s_224_hex blake2s_224_b64 blake2s_224_b64u blake2s_224_file blake2s_224_file_hex blake2s_224_file_b64 blake2s_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_256 blake2s_256_hex blake2s_256_b64 blake2s_256_b64u blake2s_256_file blake2s_256_file_hex blake2s_256_file_b64 blake2s_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( chaes chaes_hex chaes_b64 chaes_b64u chaes_file chaes_file_hex chaes_file_b64 chaes_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak224 keccak224_hex keccak224_b64 keccak224_b64u keccak224_file keccak224_file_hex keccak224_file_b64 keccak224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak256 keccak256_hex keccak256_b64 keccak256_b64u keccak256_file keccak256_file_hex keccak256_file_b64 keccak256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak384 keccak384_hex keccak384_b64 keccak384_b64u keccak384_file keccak384_file_hex keccak384_file_b64 keccak384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak512 keccak512_hex keccak512_b64 keccak512_b64u keccak512_file keccak512_file_hex keccak512_file_b64 keccak512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md2 md2_hex md2_b64 md2_b64u md2_file md2_file_hex md2_file_b64 md2_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md4 md4_hex md4_b64 md4_b64u md4_file md4_file_hex md4_file_b64 md4_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md5 md5_hex md5_b64 md5_b64u md5_file md5_file_hex md5_file_b64 md5_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha1 sha1_hex sha1_b64 sha1_b64u sha1_file sha1_file_hex sha1_file_b64 sha1_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha224 sha224_hex sha224_b64 sha224_b64u sha224_file sha224_file_hex sha224_file_b64 sha224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha256 sha256_hex sha256_b64 sha256_b64u sha256_file sha256_file_hex sha256_file_b64 sha256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha384 sha384_hex sha384_b64 sha384_b64u sha384_file sha384_file_hex sha384_file_b64 sha384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_224 sha3_224_hex sha3_224_b64 sha3_224_b64u sha3_224_file sha3_224_file_hex sha3_224_file_b64 sha3_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_256 sha3_256_hex sha3_256_b64 sha3_256_b64u sha3_256_file sha3_256_file_hex sha3_256_file_b64 sha3_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_384 sha3_384_hex sha3_384_b64 sha3_384_b64u sha3_384_file sha3_384_file_hex sha3_384_file_b64 sha3_384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_512 sha3_512_hex sha3_512_b64 sha3_512_b64u sha3_512_file sha3_512_file_hex sha3_512_file_b64 sha3_512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512 sha512_hex sha512_b64 sha512_b64u sha512_file sha512_file_hex sha512_file_b64 sha512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512_224 sha512_224_hex sha512_224_b64 sha512_224_b64u sha512_224_file sha512_224_file_hex sha512_224_file_b64 sha512_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512_256 sha512_256_hex sha512_256_b64 sha512_256_b64u sha512_256_file sha512_256_file_hex sha512_256_file_b64 sha512_256_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( tiger192 tiger192_hex tiger192_b64 tiger192_b64u tiger192_file tiger192_file_hex tiger192_file_b64 tiger192_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( digest_data digest_data_hex digest_data_b64 digest_data_b64u digest_file digest_file_hex digest_file_b64 digest_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw(pbkdf1 pbkdf2 hkdf hkdf_expand hkdf_extract)] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b blake2b_hex blake2b_b64 blake2b_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s blake2s_hex blake2s_b64 blake2s_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( f9 f9_hex f9_b64 f9_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( hmac hmac_hex hmac_b64 hmac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( omac omac_hex omac_b64 omac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pmac pmac_hex pmac_b64 pmac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pelican pelican_hex pelican_b64 pelican_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( poly1305 poly1305_hex poly1305_b64 poly1305_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( xcbc xcbc_hex xcbc_b64 xcbc_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 use Carp 'croak';
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.064';
6 our $VERSION = '0.066';
77
88 use Crypt::Cipher;
99
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 ### not used
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( dh_shared_secret )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( dsa_encrypt dsa_decrypt dsa_sign_message dsa_verify_message dsa_sign_hash dsa_verify_hash )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( ecc_encrypt ecc_decrypt ecc_sign_message ecc_verify_message ecc_sign_hash ecc_verify_hash ecc_shared_secret )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw(rsa_encrypt rsa_decrypt rsa_sign_message rsa_verify_message rsa_sign_hash rsa_verify_hash)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use Carp;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings ;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 require XSLoader;
77 XSLoader::load('CryptX', $VERSION);
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.064';
4 our $VERSION = '0.066';
55
66 use CryptX;
77 use Carp;
00 OBJS=ltc/ciphers/anubis.o ltc/ciphers/blowfish.o ltc/ciphers/camellia.o ltc/ciphers/cast5.o \
11 ltc/ciphers/des.o ltc/ciphers/idea.o ltc/ciphers/kasumi.o ltc/ciphers/khazad.o ltc/ciphers/kseed.o \
22 ltc/ciphers/multi2.o ltc/ciphers/noekeon.o ltc/ciphers/rc2.o ltc/ciphers/rc5.o ltc/ciphers/rc6.o \
3 ltc/ciphers/serpent.o ltc/ciphers/skipjack.o ltc/ciphers/xtea.o ltc/ciphers/aes/aes.o \
4 ltc/ciphers/safer/safer.o ltc/ciphers/safer/saferp.o ltc/ciphers/twofish/twofish.o \
3 ltc/ciphers/serpent.o ltc/ciphers/skipjack.o ltc/ciphers/tea.o ltc/ciphers/xtea.o \
4 ltc/ciphers/aes/aes.o ltc/ciphers/safer/safer.o ltc/ciphers/safer/saferp.o ltc/ciphers/twofish/twofish.o \
55 ltc/encauth/ccm/ccm_add_aad.o ltc/encauth/ccm/ccm_add_nonce.o ltc/encauth/ccm/ccm_done.o \
66 ltc/encauth/ccm/ccm_init.o ltc/encauth/ccm/ccm_memory.o ltc/encauth/ccm/ccm_process.o \
77 ltc/encauth/ccm/ccm_reset.o ltc/encauth/chachapoly/chacha20poly1305_add_aad.o ltc/encauth/chachapoly/chacha20poly1305_decrypt.o \
4343 ltc/misc/crc32.o ltc/misc/error_to_string.o ltc/misc/mem_neq.o ltc/misc/zeromem.o \
4444 ltc/misc/base16/base16_decode.o ltc/misc/base16/base16_encode.o ltc/misc/base32/base32_decode.o \
4545 ltc/misc/base32/base32_encode.o ltc/misc/base64/base64_decode.o ltc/misc/base64/base64_encode.o \
46 ltc/misc/crypt/crypt.o ltc/misc/crypt/crypt_argchk.o ltc/misc/crypt/crypt_cipher_descriptor.o \
46 ltc/misc/bcrypt/bcrypt.o ltc/misc/crypt/crypt.o ltc/misc/crypt/crypt_argchk.o ltc/misc/crypt/crypt_cipher_descriptor.o \
4747 ltc/misc/crypt/crypt_cipher_is_valid.o ltc/misc/crypt/crypt_constants.o ltc/misc/crypt/crypt_find_cipher.o \
4848 ltc/misc/crypt/crypt_find_cipher_any.o ltc/misc/crypt/crypt_find_cipher_id.o ltc/misc/crypt/crypt_find_hash.o \
4949 ltc/misc/crypt/crypt_find_hash_any.o ltc/misc/crypt/crypt_find_hash_id.o ltc/misc/crypt/crypt_find_hash_oid.o \
103103 ltc/pk/dsa/dsa_encrypt_key.o ltc/pk/dsa/dsa_export.o ltc/pk/dsa/dsa_free.o ltc/pk/dsa/dsa_generate_key.o \
104104 ltc/pk/dsa/dsa_generate_pqg.o ltc/pk/dsa/dsa_import.o ltc/pk/dsa/dsa_make_key.o ltc/pk/dsa/dsa_set.o \
105105 ltc/pk/dsa/dsa_set_pqg_dsaparam.o ltc/pk/dsa/dsa_shared_secret.o ltc/pk/dsa/dsa_sign_hash.o \
106 ltc/pk/dsa/dsa_verify_hash.o ltc/pk/dsa/dsa_verify_key.o ltc/pk/ecc/ecc.o ltc/pk/ecc/ecc_ansi_x963_export.o \
107 ltc/pk/ecc/ecc_ansi_x963_import.o ltc/pk/ecc/ecc_decrypt_key.o ltc/pk/ecc/ecc_encrypt_key.o \
108 ltc/pk/ecc/ecc_export.o ltc/pk/ecc/ecc_export_openssl.o ltc/pk/ecc/ecc_find_curve.o \
109 ltc/pk/ecc/ecc_free.o ltc/pk/ecc/ecc_get_key.o ltc/pk/ecc/ecc_get_oid_str.o ltc/pk/ecc/ecc_get_size.o \
110 ltc/pk/ecc/ecc_import.o ltc/pk/ecc/ecc_import_openssl.o ltc/pk/ecc/ecc_import_pkcs8.o \
111 ltc/pk/ecc/ecc_import_x509.o ltc/pk/ecc/ecc_make_key.o ltc/pk/ecc/ecc_recover_key.o \
112 ltc/pk/ecc/ecc_set_curve.o ltc/pk/ecc/ecc_set_curve_internal.o ltc/pk/ecc/ecc_set_key.o \
113 ltc/pk/ecc/ecc_shared_secret.o ltc/pk/ecc/ecc_sign_hash.o ltc/pk/ecc/ecc_sizes.o \
114 ltc/pk/ecc/ecc_ssh_ecdsa_encode_name.o ltc/pk/ecc/ecc_verify_hash.o ltc/pk/ecc/ltc_ecc_export_point.o \
115 ltc/pk/ecc/ltc_ecc_import_point.o ltc/pk/ecc/ltc_ecc_is_point.o ltc/pk/ecc/ltc_ecc_is_point_at_infinity.o \
116 ltc/pk/ecc/ltc_ecc_map.o ltc/pk/ecc/ltc_ecc_mul2add.o ltc/pk/ecc/ltc_ecc_mulmod.o \
117 ltc/pk/ecc/ltc_ecc_mulmod_timing.o ltc/pk/ecc/ltc_ecc_points.o ltc/pk/ecc/ltc_ecc_projective_add_point.o \
118 ltc/pk/ecc/ltc_ecc_projective_dbl_point.o ltc/pk/ecc/ltc_ecc_verify_key.o ltc/pk/pkcs1/pkcs_1_i2osp.o \
119 ltc/pk/pkcs1/pkcs_1_mgf1.o ltc/pk/pkcs1/pkcs_1_oaep_decode.o ltc/pk/pkcs1/pkcs_1_oaep_encode.o \
120 ltc/pk/pkcs1/pkcs_1_os2ip.o ltc/pk/pkcs1/pkcs_1_pss_decode.o ltc/pk/pkcs1/pkcs_1_pss_encode.o \
121 ltc/pk/pkcs1/pkcs_1_v1_5_decode.o ltc/pk/pkcs1/pkcs_1_v1_5_encode.o ltc/pk/rsa/rsa_decrypt_key.o \
122 ltc/pk/rsa/rsa_encrypt_key.o ltc/pk/rsa/rsa_export.o ltc/pk/rsa/rsa_exptmod.o ltc/pk/rsa/rsa_free.o \
123 ltc/pk/rsa/rsa_get_size.o ltc/pk/rsa/rsa_import.o ltc/pk/rsa/rsa_import_pkcs8.o ltc/pk/rsa/rsa_import_x509.o \
124 ltc/pk/rsa/rsa_make_key.o ltc/pk/rsa/rsa_set.o ltc/pk/rsa/rsa_sign_hash.o ltc/pk/rsa/rsa_sign_saltlen_get.o \
125 ltc/pk/rsa/rsa_verify_hash.o ltc/prngs/chacha20.o ltc/prngs/fortuna.o ltc/prngs/rc4.o \
106 ltc/pk/dsa/dsa_verify_hash.o ltc/pk/dsa/dsa_verify_key.o ltc/pk/ec25519/ec25519_export.o \
107 ltc/pk/ec25519/ec25519_import_pkcs8.o ltc/pk/ec25519/tweetnacl.o ltc/pk/ecc/ecc.o \
108 ltc/pk/ecc/ecc_ansi_x963_export.o ltc/pk/ecc/ecc_ansi_x963_import.o ltc/pk/ecc/ecc_decrypt_key.o \
109 ltc/pk/ecc/ecc_encrypt_key.o ltc/pk/ecc/ecc_export.o ltc/pk/ecc/ecc_export_openssl.o \
110 ltc/pk/ecc/ecc_find_curve.o ltc/pk/ecc/ecc_free.o ltc/pk/ecc/ecc_get_key.o ltc/pk/ecc/ecc_get_oid_str.o \
111 ltc/pk/ecc/ecc_get_size.o ltc/pk/ecc/ecc_import.o ltc/pk/ecc/ecc_import_openssl.o \
112 ltc/pk/ecc/ecc_import_pkcs8.o ltc/pk/ecc/ecc_import_x509.o ltc/pk/ecc/ecc_make_key.o \
113 ltc/pk/ecc/ecc_recover_key.o ltc/pk/ecc/ecc_set_curve.o ltc/pk/ecc/ecc_set_curve_internal.o \
114 ltc/pk/ecc/ecc_set_key.o ltc/pk/ecc/ecc_shared_secret.o ltc/pk/ecc/ecc_sign_hash.o \
115 ltc/pk/ecc/ecc_sizes.o ltc/pk/ecc/ecc_ssh_ecdsa_encode_name.o ltc/pk/ecc/ecc_verify_hash.o \
116 ltc/pk/ecc/ltc_ecc_export_point.o ltc/pk/ecc/ltc_ecc_import_point.o ltc/pk/ecc/ltc_ecc_is_point.o \
117 ltc/pk/ecc/ltc_ecc_is_point_at_infinity.o ltc/pk/ecc/ltc_ecc_map.o ltc/pk/ecc/ltc_ecc_mul2add.o \
118 ltc/pk/ecc/ltc_ecc_mulmod.o ltc/pk/ecc/ltc_ecc_mulmod_timing.o ltc/pk/ecc/ltc_ecc_points.o \
119 ltc/pk/ecc/ltc_ecc_projective_add_point.o ltc/pk/ecc/ltc_ecc_projective_dbl_point.o \
120 ltc/pk/ecc/ltc_ecc_verify_key.o ltc/pk/ed25519/ed25519_export.o ltc/pk/ed25519/ed25519_import.o \
121 ltc/pk/ed25519/ed25519_import_pkcs8.o ltc/pk/ed25519/ed25519_import_x509.o ltc/pk/ed25519/ed25519_make_key.o \
122 ltc/pk/ed25519/ed25519_set_key.o ltc/pk/ed25519/ed25519_sign.o ltc/pk/ed25519/ed25519_verify.o \
123 ltc/pk/pkcs1/pkcs_1_i2osp.o ltc/pk/pkcs1/pkcs_1_mgf1.o ltc/pk/pkcs1/pkcs_1_oaep_decode.o \
124 ltc/pk/pkcs1/pkcs_1_oaep_encode.o ltc/pk/pkcs1/pkcs_1_os2ip.o ltc/pk/pkcs1/pkcs_1_pss_decode.o \
125 ltc/pk/pkcs1/pkcs_1_pss_encode.o ltc/pk/pkcs1/pkcs_1_v1_5_decode.o ltc/pk/pkcs1/pkcs_1_v1_5_encode.o \
126 ltc/pk/rsa/rsa_decrypt_key.o ltc/pk/rsa/rsa_encrypt_key.o ltc/pk/rsa/rsa_export.o \
127 ltc/pk/rsa/rsa_exptmod.o ltc/pk/rsa/rsa_get_size.o ltc/pk/rsa/rsa_import.o ltc/pk/rsa/rsa_import_pkcs8.o \
128 ltc/pk/rsa/rsa_import_x509.o ltc/pk/rsa/rsa_key.o ltc/pk/rsa/rsa_make_key.o ltc/pk/rsa/rsa_set.o \
129 ltc/pk/rsa/rsa_sign_hash.o ltc/pk/rsa/rsa_sign_saltlen_get.o ltc/pk/rsa/rsa_verify_hash.o \
130 ltc/pk/x25519/x25519_export.o ltc/pk/x25519/x25519_import.o ltc/pk/x25519/x25519_import_pkcs8.o \
131 ltc/pk/x25519/x25519_import_x509.o ltc/pk/x25519/x25519_make_key.o ltc/pk/x25519/x25519_set_key.o \
132 ltc/pk/x25519/x25519_shared_secret.o ltc/prngs/chacha20.o ltc/prngs/fortuna.o ltc/prngs/rc4.o \
126133 ltc/prngs/rng_get_bytes.o ltc/prngs/rng_make_prng.o ltc/prngs/sober128.o ltc/prngs/sprng.o \
127134 ltc/prngs/yarrow.o ltc/stream/chacha/chacha_crypt.o ltc/stream/chacha/chacha_done.o \
128135 ltc/stream/chacha/chacha_ivctr32.o ltc/stream/chacha/chacha_ivctr64.o ltc/stream/chacha/chacha_keystream.o \
11 ltc/ciphers/des.obj ltc/ciphers/idea.obj ltc/ciphers/kasumi.obj ltc/ciphers/khazad.obj \
22 ltc/ciphers/kseed.obj ltc/ciphers/multi2.obj ltc/ciphers/noekeon.obj ltc/ciphers/rc2.obj \
33 ltc/ciphers/rc5.obj ltc/ciphers/rc6.obj ltc/ciphers/serpent.obj ltc/ciphers/skipjack.obj \
4 ltc/ciphers/xtea.obj ltc/ciphers/aes/aes.obj ltc/ciphers/safer/safer.obj ltc/ciphers/safer/saferp.obj \
5 ltc/ciphers/twofish/twofish.obj ltc/encauth/ccm/ccm_add_aad.obj ltc/encauth/ccm/ccm_add_nonce.obj \
6 ltc/encauth/ccm/ccm_done.obj ltc/encauth/ccm/ccm_init.obj ltc/encauth/ccm/ccm_memory.obj \
7 ltc/encauth/ccm/ccm_process.obj ltc/encauth/ccm/ccm_reset.obj ltc/encauth/chachapoly/chacha20poly1305_add_aad.obj \
8 ltc/encauth/chachapoly/chacha20poly1305_decrypt.obj ltc/encauth/chachapoly/chacha20poly1305_done.obj \
9 ltc/encauth/chachapoly/chacha20poly1305_encrypt.obj ltc/encauth/chachapoly/chacha20poly1305_init.obj \
10 ltc/encauth/chachapoly/chacha20poly1305_memory.obj ltc/encauth/chachapoly/chacha20poly1305_setiv.obj \
11 ltc/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.obj ltc/encauth/eax/eax_addheader.obj \
12 ltc/encauth/eax/eax_decrypt.obj ltc/encauth/eax/eax_decrypt_verify_memory.obj ltc/encauth/eax/eax_done.obj \
13 ltc/encauth/eax/eax_encrypt.obj ltc/encauth/eax/eax_encrypt_authenticate_memory.obj \
4 ltc/ciphers/tea.obj ltc/ciphers/xtea.obj ltc/ciphers/aes/aes.obj ltc/ciphers/safer/safer.obj \
5 ltc/ciphers/safer/saferp.obj ltc/ciphers/twofish/twofish.obj ltc/encauth/ccm/ccm_add_aad.obj \
6 ltc/encauth/ccm/ccm_add_nonce.obj ltc/encauth/ccm/ccm_done.obj ltc/encauth/ccm/ccm_init.obj \
7 ltc/encauth/ccm/ccm_memory.obj ltc/encauth/ccm/ccm_process.obj ltc/encauth/ccm/ccm_reset.obj \
8 ltc/encauth/chachapoly/chacha20poly1305_add_aad.obj ltc/encauth/chachapoly/chacha20poly1305_decrypt.obj \
9 ltc/encauth/chachapoly/chacha20poly1305_done.obj ltc/encauth/chachapoly/chacha20poly1305_encrypt.obj \
10 ltc/encauth/chachapoly/chacha20poly1305_init.obj ltc/encauth/chachapoly/chacha20poly1305_memory.obj \
11 ltc/encauth/chachapoly/chacha20poly1305_setiv.obj ltc/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.obj \
12 ltc/encauth/eax/eax_addheader.obj ltc/encauth/eax/eax_decrypt.obj ltc/encauth/eax/eax_decrypt_verify_memory.obj \
13 ltc/encauth/eax/eax_done.obj ltc/encauth/eax/eax_encrypt.obj ltc/encauth/eax/eax_encrypt_authenticate_memory.obj \
1414 ltc/encauth/eax/eax_init.obj ltc/encauth/gcm/gcm_add_aad.obj ltc/encauth/gcm/gcm_add_iv.obj \
1515 ltc/encauth/gcm/gcm_done.obj ltc/encauth/gcm/gcm_gf_mult.obj ltc/encauth/gcm/gcm_init.obj \
1616 ltc/encauth/gcm/gcm_memory.obj ltc/encauth/gcm/gcm_mult_h.obj ltc/encauth/gcm/gcm_process.obj \
4646 ltc/misc/crc32.obj ltc/misc/error_to_string.obj ltc/misc/mem_neq.obj ltc/misc/zeromem.obj \
4747 ltc/misc/base16/base16_decode.obj ltc/misc/base16/base16_encode.obj ltc/misc/base32/base32_decode.obj \
4848 ltc/misc/base32/base32_encode.obj ltc/misc/base64/base64_decode.obj ltc/misc/base64/base64_encode.obj \
49 ltc/misc/crypt/crypt.obj ltc/misc/crypt/crypt_argchk.obj ltc/misc/crypt/crypt_cipher_descriptor.obj \
50 ltc/misc/crypt/crypt_cipher_is_valid.obj ltc/misc/crypt/crypt_constants.obj ltc/misc/crypt/crypt_find_cipher.obj \
51 ltc/misc/crypt/crypt_find_cipher_any.obj ltc/misc/crypt/crypt_find_cipher_id.obj \
52 ltc/misc/crypt/crypt_find_hash.obj ltc/misc/crypt/crypt_find_hash_any.obj ltc/misc/crypt/crypt_find_hash_id.obj \
53 ltc/misc/crypt/crypt_find_hash_oid.obj ltc/misc/crypt/crypt_find_prng.obj ltc/misc/crypt/crypt_fsa.obj \
54 ltc/misc/crypt/crypt_hash_descriptor.obj ltc/misc/crypt/crypt_hash_is_valid.obj ltc/misc/crypt/crypt_inits.obj \
55 ltc/misc/crypt/crypt_ltc_mp_descriptor.obj ltc/misc/crypt/crypt_prng_descriptor.obj \
49 ltc/misc/bcrypt/bcrypt.obj ltc/misc/crypt/crypt.obj ltc/misc/crypt/crypt_argchk.obj \
50 ltc/misc/crypt/crypt_cipher_descriptor.obj ltc/misc/crypt/crypt_cipher_is_valid.obj \
51 ltc/misc/crypt/crypt_constants.obj ltc/misc/crypt/crypt_find_cipher.obj ltc/misc/crypt/crypt_find_cipher_any.obj \
52 ltc/misc/crypt/crypt_find_cipher_id.obj ltc/misc/crypt/crypt_find_hash.obj ltc/misc/crypt/crypt_find_hash_any.obj \
53 ltc/misc/crypt/crypt_find_hash_id.obj ltc/misc/crypt/crypt_find_hash_oid.obj ltc/misc/crypt/crypt_find_prng.obj \
54 ltc/misc/crypt/crypt_fsa.obj ltc/misc/crypt/crypt_hash_descriptor.obj ltc/misc/crypt/crypt_hash_is_valid.obj \
55 ltc/misc/crypt/crypt_inits.obj ltc/misc/crypt/crypt_ltc_mp_descriptor.obj ltc/misc/crypt/crypt_prng_descriptor.obj \
5656 ltc/misc/crypt/crypt_prng_is_valid.obj ltc/misc/crypt/crypt_prng_rng_descriptor.obj \
5757 ltc/misc/crypt/crypt_register_all_ciphers.obj ltc/misc/crypt/crypt_register_all_hashes.obj \
5858 ltc/misc/crypt/crypt_register_all_prngs.obj ltc/misc/crypt/crypt_register_cipher.obj \
110110 ltc/pk/dsa/dsa_generate_key.obj ltc/pk/dsa/dsa_generate_pqg.obj ltc/pk/dsa/dsa_import.obj \
111111 ltc/pk/dsa/dsa_make_key.obj ltc/pk/dsa/dsa_set.obj ltc/pk/dsa/dsa_set_pqg_dsaparam.obj \
112112 ltc/pk/dsa/dsa_shared_secret.obj ltc/pk/dsa/dsa_sign_hash.obj ltc/pk/dsa/dsa_verify_hash.obj \
113 ltc/pk/dsa/dsa_verify_key.obj ltc/pk/ecc/ecc.obj ltc/pk/ecc/ecc_ansi_x963_export.obj \
113 ltc/pk/dsa/dsa_verify_key.obj ltc/pk/ec25519/ec25519_export.obj ltc/pk/ec25519/ec25519_import_pkcs8.obj \
114 ltc/pk/ec25519/tweetnacl.obj ltc/pk/ecc/ecc.obj ltc/pk/ecc/ecc_ansi_x963_export.obj \
114115 ltc/pk/ecc/ecc_ansi_x963_import.obj ltc/pk/ecc/ecc_decrypt_key.obj ltc/pk/ecc/ecc_encrypt_key.obj \
115116 ltc/pk/ecc/ecc_export.obj ltc/pk/ecc/ecc_export_openssl.obj ltc/pk/ecc/ecc_find_curve.obj \
116117 ltc/pk/ecc/ecc_free.obj ltc/pk/ecc/ecc_get_key.obj ltc/pk/ecc/ecc_get_oid_str.obj \
123124 ltc/pk/ecc/ltc_ecc_is_point_at_infinity.obj ltc/pk/ecc/ltc_ecc_map.obj ltc/pk/ecc/ltc_ecc_mul2add.obj \
124125 ltc/pk/ecc/ltc_ecc_mulmod.obj ltc/pk/ecc/ltc_ecc_mulmod_timing.obj ltc/pk/ecc/ltc_ecc_points.obj \
125126 ltc/pk/ecc/ltc_ecc_projective_add_point.obj ltc/pk/ecc/ltc_ecc_projective_dbl_point.obj \
126 ltc/pk/ecc/ltc_ecc_verify_key.obj ltc/pk/pkcs1/pkcs_1_i2osp.obj ltc/pk/pkcs1/pkcs_1_mgf1.obj \
127 ltc/pk/pkcs1/pkcs_1_oaep_decode.obj ltc/pk/pkcs1/pkcs_1_oaep_encode.obj ltc/pk/pkcs1/pkcs_1_os2ip.obj \
128 ltc/pk/pkcs1/pkcs_1_pss_decode.obj ltc/pk/pkcs1/pkcs_1_pss_encode.obj ltc/pk/pkcs1/pkcs_1_v1_5_decode.obj \
129 ltc/pk/pkcs1/pkcs_1_v1_5_encode.obj ltc/pk/rsa/rsa_decrypt_key.obj ltc/pk/rsa/rsa_encrypt_key.obj \
130 ltc/pk/rsa/rsa_export.obj ltc/pk/rsa/rsa_exptmod.obj ltc/pk/rsa/rsa_free.obj ltc/pk/rsa/rsa_get_size.obj \
131 ltc/pk/rsa/rsa_import.obj ltc/pk/rsa/rsa_import_pkcs8.obj ltc/pk/rsa/rsa_import_x509.obj \
127 ltc/pk/ecc/ltc_ecc_verify_key.obj ltc/pk/ed25519/ed25519_export.obj ltc/pk/ed25519/ed25519_import.obj \
128 ltc/pk/ed25519/ed25519_import_pkcs8.obj ltc/pk/ed25519/ed25519_import_x509.obj ltc/pk/ed25519/ed25519_make_key.obj \
129 ltc/pk/ed25519/ed25519_set_key.obj ltc/pk/ed25519/ed25519_sign.obj ltc/pk/ed25519/ed25519_verify.obj \
130 ltc/pk/pkcs1/pkcs_1_i2osp.obj ltc/pk/pkcs1/pkcs_1_mgf1.obj ltc/pk/pkcs1/pkcs_1_oaep_decode.obj \
131 ltc/pk/pkcs1/pkcs_1_oaep_encode.obj ltc/pk/pkcs1/pkcs_1_os2ip.obj ltc/pk/pkcs1/pkcs_1_pss_decode.obj \
132 ltc/pk/pkcs1/pkcs_1_pss_encode.obj ltc/pk/pkcs1/pkcs_1_v1_5_decode.obj ltc/pk/pkcs1/pkcs_1_v1_5_encode.obj \
133 ltc/pk/rsa/rsa_decrypt_key.obj ltc/pk/rsa/rsa_encrypt_key.obj ltc/pk/rsa/rsa_export.obj \
134 ltc/pk/rsa/rsa_exptmod.obj ltc/pk/rsa/rsa_get_size.obj ltc/pk/rsa/rsa_import.obj \
135 ltc/pk/rsa/rsa_import_pkcs8.obj ltc/pk/rsa/rsa_import_x509.obj ltc/pk/rsa/rsa_key.obj \
132136 ltc/pk/rsa/rsa_make_key.obj ltc/pk/rsa/rsa_set.obj ltc/pk/rsa/rsa_sign_hash.obj ltc/pk/rsa/rsa_sign_saltlen_get.obj \
133 ltc/pk/rsa/rsa_verify_hash.obj ltc/prngs/chacha20.obj ltc/prngs/fortuna.obj ltc/prngs/rc4.obj \
134 ltc/prngs/rng_get_bytes.obj ltc/prngs/rng_make_prng.obj ltc/prngs/sober128.obj ltc/prngs/sprng.obj \
135 ltc/prngs/yarrow.obj ltc/stream/chacha/chacha_crypt.obj ltc/stream/chacha/chacha_done.obj \
136 ltc/stream/chacha/chacha_ivctr32.obj ltc/stream/chacha/chacha_ivctr64.obj ltc/stream/chacha/chacha_keystream.obj \
137 ltc/stream/chacha/chacha_memory.obj ltc/stream/chacha/chacha_setup.obj ltc/stream/rabbit/rabbit.obj \
138 ltc/stream/rabbit/rabbit_memory.obj ltc/stream/rc4/rc4_stream.obj ltc/stream/rc4/rc4_stream_memory.obj \
139 ltc/stream/salsa20/salsa20_crypt.obj ltc/stream/salsa20/salsa20_done.obj ltc/stream/salsa20/salsa20_ivctr64.obj \
140 ltc/stream/salsa20/salsa20_keystream.obj ltc/stream/salsa20/salsa20_memory.obj ltc/stream/salsa20/salsa20_setup.obj \
141 ltc/stream/salsa20/xsalsa20_memory.obj ltc/stream/salsa20/xsalsa20_setup.obj ltc/stream/sober128/sober128_stream.obj \
142 ltc/stream/sober128/sober128_stream_memory.obj ltc/stream/sosemanuk/sosemanuk.obj \
143 ltc/stream/sosemanuk/sosemanuk_memory.obj ltm/bncore.obj ltm/bn_error.obj ltm/bn_fast_mp_invmod.obj \
144 ltm/bn_fast_mp_montgomery_reduce.obj ltm/bn_fast_s_mp_mul_digs.obj ltm/bn_fast_s_mp_mul_high_digs.obj \
145 ltm/bn_fast_s_mp_sqr.obj ltm/bn_mp_2expt.obj ltm/bn_mp_abs.obj ltm/bn_mp_add.obj \
146 ltm/bn_mp_addmod.obj ltm/bn_mp_add_d.obj ltm/bn_mp_and.obj ltm/bn_mp_clamp.obj ltm/bn_mp_clear.obj \
147 ltm/bn_mp_clear_multi.obj ltm/bn_mp_cmp.obj ltm/bn_mp_cmp_d.obj ltm/bn_mp_cmp_mag.obj \
148 ltm/bn_mp_cnt_lsb.obj ltm/bn_mp_complement.obj ltm/bn_mp_copy.obj ltm/bn_mp_count_bits.obj \
149 ltm/bn_mp_div.obj ltm/bn_mp_div_2.obj ltm/bn_mp_div_2d.obj ltm/bn_mp_div_3.obj ltm/bn_mp_div_d.obj \
150 ltm/bn_mp_dr_is_modulus.obj ltm/bn_mp_dr_reduce.obj ltm/bn_mp_dr_setup.obj ltm/bn_mp_exch.obj \
151 ltm/bn_mp_export.obj ltm/bn_mp_exptmod.obj ltm/bn_mp_exptmod_fast.obj ltm/bn_mp_expt_d.obj \
152 ltm/bn_mp_expt_d_ex.obj ltm/bn_mp_exteuclid.obj ltm/bn_mp_fread.obj ltm/bn_mp_fwrite.obj \
153 ltm/bn_mp_gcd.obj ltm/bn_mp_get_bit.obj ltm/bn_mp_get_int.obj ltm/bn_mp_get_long.obj \
154 ltm/bn_mp_grow.obj ltm/bn_mp_import.obj ltm/bn_mp_init.obj ltm/bn_mp_init_copy.obj \
155 ltm/bn_mp_init_multi.obj ltm/bn_mp_init_set.obj ltm/bn_mp_init_set_int.obj ltm/bn_mp_init_size.obj \
156 ltm/bn_mp_invmod.obj ltm/bn_mp_invmod_slow.obj ltm/bn_mp_is_square.obj ltm/bn_mp_jacobi.obj \
157 ltm/bn_mp_karatsuba_mul.obj ltm/bn_mp_karatsuba_sqr.obj ltm/bn_mp_kronecker.obj ltm/bn_mp_lcm.obj \
158 ltm/bn_mp_lshd.obj ltm/bn_mp_mod.obj ltm/bn_mp_mod_2d.obj ltm/bn_mp_mod_d.obj ltm/bn_mp_montgomery_calc_normalization.obj \
159 ltm/bn_mp_montgomery_reduce.obj ltm/bn_mp_montgomery_setup.obj ltm/bn_mp_mul.obj \
160 ltm/bn_mp_mulmod.obj ltm/bn_mp_mul_2.obj ltm/bn_mp_mul_2d.obj ltm/bn_mp_mul_d.obj \
161 ltm/bn_mp_neg.obj ltm/bn_mp_n_root.obj ltm/bn_mp_n_root_ex.obj ltm/bn_mp_or.obj ltm/bn_mp_prime_fermat.obj \
162 ltm/bn_mp_prime_frobenius_underwood.obj ltm/bn_mp_prime_is_divisible.obj ltm/bn_mp_prime_is_prime.obj \
163 ltm/bn_mp_prime_miller_rabin.obj ltm/bn_mp_prime_next_prime.obj ltm/bn_mp_prime_rabin_miller_trials.obj \
164 ltm/bn_mp_prime_random_ex.obj ltm/bn_mp_prime_strong_lucas_selfridge.obj ltm/bn_mp_radix_size.obj \
165 ltm/bn_mp_radix_smap.obj ltm/bn_mp_rand.obj ltm/bn_mp_read_radix.obj ltm/bn_mp_read_signed_bin.obj \
166 ltm/bn_mp_read_unsigned_bin.obj ltm/bn_mp_reduce.obj ltm/bn_mp_reduce_2k.obj ltm/bn_mp_reduce_2k_l.obj \
167 ltm/bn_mp_reduce_2k_setup.obj ltm/bn_mp_reduce_2k_setup_l.obj ltm/bn_mp_reduce_is_2k.obj \
168 ltm/bn_mp_reduce_is_2k_l.obj ltm/bn_mp_reduce_setup.obj ltm/bn_mp_rshd.obj ltm/bn_mp_set.obj \
169 ltm/bn_mp_set_int.obj ltm/bn_mp_set_long.obj ltm/bn_mp_shrink.obj ltm/bn_mp_signed_bin_size.obj \
170 ltm/bn_mp_sqr.obj ltm/bn_mp_sqrmod.obj ltm/bn_mp_sqrt.obj ltm/bn_mp_sqrtmod_prime.obj \
171 ltm/bn_mp_sub.obj ltm/bn_mp_submod.obj ltm/bn_mp_sub_d.obj ltm/bn_mp_tc_and.obj ltm/bn_mp_tc_div_2d.obj \
137 ltc/pk/rsa/rsa_verify_hash.obj ltc/pk/x25519/x25519_export.obj ltc/pk/x25519/x25519_import.obj \
138 ltc/pk/x25519/x25519_import_pkcs8.obj ltc/pk/x25519/x25519_import_x509.obj ltc/pk/x25519/x25519_make_key.obj \
139 ltc/pk/x25519/x25519_set_key.obj ltc/pk/x25519/x25519_shared_secret.obj ltc/prngs/chacha20.obj \
140 ltc/prngs/fortuna.obj ltc/prngs/rc4.obj ltc/prngs/rng_get_bytes.obj ltc/prngs/rng_make_prng.obj \
141 ltc/prngs/sober128.obj ltc/prngs/sprng.obj ltc/prngs/yarrow.obj ltc/stream/chacha/chacha_crypt.obj \
142 ltc/stream/chacha/chacha_done.obj ltc/stream/chacha/chacha_ivctr32.obj ltc/stream/chacha/chacha_ivctr64.obj \
143 ltc/stream/chacha/chacha_keystream.obj ltc/stream/chacha/chacha_memory.obj ltc/stream/chacha/chacha_setup.obj \
144 ltc/stream/rabbit/rabbit.obj ltc/stream/rabbit/rabbit_memory.obj ltc/stream/rc4/rc4_stream.obj \
145 ltc/stream/rc4/rc4_stream_memory.obj ltc/stream/salsa20/salsa20_crypt.obj ltc/stream/salsa20/salsa20_done.obj \
146 ltc/stream/salsa20/salsa20_ivctr64.obj ltc/stream/salsa20/salsa20_keystream.obj ltc/stream/salsa20/salsa20_memory.obj \
147 ltc/stream/salsa20/salsa20_setup.obj ltc/stream/salsa20/xsalsa20_memory.obj ltc/stream/salsa20/xsalsa20_setup.obj \
148 ltc/stream/sober128/sober128_stream.obj ltc/stream/sober128/sober128_stream_memory.obj \
149 ltc/stream/sosemanuk/sosemanuk.obj ltc/stream/sosemanuk/sosemanuk_memory.obj ltm/bncore.obj \
150 ltm/bn_error.obj ltm/bn_fast_mp_invmod.obj ltm/bn_fast_mp_montgomery_reduce.obj ltm/bn_fast_s_mp_mul_digs.obj \
151 ltm/bn_fast_s_mp_mul_high_digs.obj ltm/bn_fast_s_mp_sqr.obj ltm/bn_mp_2expt.obj ltm/bn_mp_abs.obj \
152 ltm/bn_mp_add.obj ltm/bn_mp_addmod.obj ltm/bn_mp_add_d.obj ltm/bn_mp_and.obj ltm/bn_mp_clamp.obj \
153 ltm/bn_mp_clear.obj ltm/bn_mp_clear_multi.obj ltm/bn_mp_cmp.obj ltm/bn_mp_cmp_d.obj \
154 ltm/bn_mp_cmp_mag.obj ltm/bn_mp_cnt_lsb.obj ltm/bn_mp_complement.obj ltm/bn_mp_copy.obj \
155 ltm/bn_mp_count_bits.obj ltm/bn_mp_div.obj ltm/bn_mp_div_2.obj ltm/bn_mp_div_2d.obj \
156 ltm/bn_mp_div_3.obj ltm/bn_mp_div_d.obj ltm/bn_mp_dr_is_modulus.obj ltm/bn_mp_dr_reduce.obj \
157 ltm/bn_mp_dr_setup.obj ltm/bn_mp_exch.obj ltm/bn_mp_export.obj ltm/bn_mp_exptmod.obj \
158 ltm/bn_mp_exptmod_fast.obj ltm/bn_mp_expt_d.obj ltm/bn_mp_expt_d_ex.obj ltm/bn_mp_exteuclid.obj \
159 ltm/bn_mp_fread.obj ltm/bn_mp_fwrite.obj ltm/bn_mp_gcd.obj ltm/bn_mp_get_bit.obj \
160 ltm/bn_mp_get_int.obj ltm/bn_mp_get_long.obj ltm/bn_mp_grow.obj ltm/bn_mp_import.obj \
161 ltm/bn_mp_init.obj ltm/bn_mp_init_copy.obj ltm/bn_mp_init_multi.obj ltm/bn_mp_init_set.obj \
162 ltm/bn_mp_init_set_int.obj ltm/bn_mp_init_size.obj ltm/bn_mp_invmod.obj ltm/bn_mp_invmod_slow.obj \
163 ltm/bn_mp_is_square.obj ltm/bn_mp_jacobi.obj ltm/bn_mp_karatsuba_mul.obj ltm/bn_mp_karatsuba_sqr.obj \
164 ltm/bn_mp_kronecker.obj ltm/bn_mp_lcm.obj ltm/bn_mp_lshd.obj ltm/bn_mp_mod.obj ltm/bn_mp_mod_2d.obj \
165 ltm/bn_mp_mod_d.obj ltm/bn_mp_montgomery_calc_normalization.obj ltm/bn_mp_montgomery_reduce.obj \
166 ltm/bn_mp_montgomery_setup.obj ltm/bn_mp_mul.obj ltm/bn_mp_mulmod.obj ltm/bn_mp_mul_2.obj \
167 ltm/bn_mp_mul_2d.obj ltm/bn_mp_mul_d.obj ltm/bn_mp_neg.obj ltm/bn_mp_n_root.obj ltm/bn_mp_n_root_ex.obj \
168 ltm/bn_mp_or.obj ltm/bn_mp_prime_fermat.obj ltm/bn_mp_prime_frobenius_underwood.obj \
169 ltm/bn_mp_prime_is_divisible.obj ltm/bn_mp_prime_is_prime.obj ltm/bn_mp_prime_miller_rabin.obj \
170 ltm/bn_mp_prime_next_prime.obj ltm/bn_mp_prime_rabin_miller_trials.obj ltm/bn_mp_prime_random_ex.obj \
171 ltm/bn_mp_prime_strong_lucas_selfridge.obj ltm/bn_mp_radix_size.obj ltm/bn_mp_radix_smap.obj \
172 ltm/bn_mp_rand.obj ltm/bn_mp_read_radix.obj ltm/bn_mp_read_signed_bin.obj ltm/bn_mp_read_unsigned_bin.obj \
173 ltm/bn_mp_reduce.obj ltm/bn_mp_reduce_2k.obj ltm/bn_mp_reduce_2k_l.obj ltm/bn_mp_reduce_2k_setup.obj \
174 ltm/bn_mp_reduce_2k_setup_l.obj ltm/bn_mp_reduce_is_2k.obj ltm/bn_mp_reduce_is_2k_l.obj \
175 ltm/bn_mp_reduce_setup.obj ltm/bn_mp_rshd.obj ltm/bn_mp_set.obj ltm/bn_mp_set_int.obj \
176 ltm/bn_mp_set_long.obj ltm/bn_mp_shrink.obj ltm/bn_mp_signed_bin_size.obj ltm/bn_mp_sqr.obj \
177 ltm/bn_mp_sqrmod.obj ltm/bn_mp_sqrt.obj ltm/bn_mp_sqrtmod_prime.obj ltm/bn_mp_sub.obj \
178 ltm/bn_mp_submod.obj ltm/bn_mp_sub_d.obj ltm/bn_mp_tc_and.obj ltm/bn_mp_tc_div_2d.obj \
172179 ltm/bn_mp_tc_or.obj ltm/bn_mp_tc_xor.obj ltm/bn_mp_toom_mul.obj ltm/bn_mp_toom_sqr.obj \
173180 ltm/bn_mp_toradix.obj ltm/bn_mp_toradix_n.obj ltm/bn_mp_to_signed_bin.obj ltm/bn_mp_to_signed_bin_n.obj \
174181 ltm/bn_mp_to_unsigned_bin.obj ltm/bn_mp_to_unsigned_bin_n.obj ltm/bn_mp_unsigned_bin_size.obj \
294294 LTC_ARGCHK(skey != NULL);
295295
296296 Nr = skey->rijndael.Nr;
297
298 if (Nr < 2 || Nr > 16)
299 return CRYPT_INVALID_ROUNDS;
300
297301 rk = skey->rijndael.eK;
298302
299303 /*
474478 LTC_ARGCHK(skey != NULL);
475479
476480 Nr = skey->rijndael.Nr;
481
482 if (Nr < 2 || Nr > 16)
483 return CRYPT_INVALID_ROUNDS;
484
477485 rk = skey->rijndael.dK;
478486
479487 /*
11301130 LTC_ARGCHK(pt != NULL);
11311131 LTC_ARGCHK(ct != NULL);
11321132 LTC_ARGCHK(skey != NULL);
1133
1134 if (skey->anubis.R < 12 || skey->anubis.R > 18) {
1135 return CRYPT_INVALID_ROUNDS;
1136 }
1137
11331138 anubis_crypt(pt, ct, skey->anubis.roundKeyEnc, skey->anubis.R);
11341139 return CRYPT_OK;
11351140 }
11461151 LTC_ARGCHK(pt != NULL);
11471152 LTC_ARGCHK(ct != NULL);
11481153 LTC_ARGCHK(skey != NULL);
1154
1155 if (skey->anubis.R < 12 || skey->anubis.R > 18) {
1156 return CRYPT_INVALID_ROUNDS;
1157 }
1158
11491159 anubis_crypt(ct, pt, skey->anubis.roundKeyDec, skey->anubis.R);
11501160 return CRYPT_OK;
11511161 }
294294 0xB74E6132UL, 0xCE77E25BUL, 0x578FDFE3UL, 0x3AC372E6UL }
295295 };
296296
297 #ifndef __GNUC__
298 #define F(x) ((S1[LTC_BYTE(x,3)] + S2[LTC_BYTE(x,2)]) ^ S3[LTC_BYTE(x,1)]) + S4[LTC_BYTE(x,0)]
299 #else
300 #define F(x) ((skey->blowfish.S[0][LTC_BYTE(x,3)] + skey->blowfish.S[1][LTC_BYTE(x,2)]) ^ skey->blowfish.S[2][LTC_BYTE(x,1)]) + skey->blowfish.S[3][LTC_BYTE(x,0)]
301 #endif
302
303 static void s_blowfish_encipher(ulong32 *L, ulong32 *R, const symmetric_key *skey)
304 {
305 int rounds;
306
307 ulong32 l, r;
308 #ifndef __GNUC__
309 const ulong32 *S1, *S2, *S3, *S4;
310
311 S1 = skey->blowfish.S[0];
312 S2 = skey->blowfish.S[1];
313 S3 = skey->blowfish.S[2];
314 S4 = skey->blowfish.S[3];
315 #endif
316
317 l = *L;
318 r = *R;
319
320 /* do 16 rounds */
321 for (rounds = 0; rounds < 16; ) {
322 l ^= skey->blowfish.K[rounds++]; r ^= F(l);
323 r ^= skey->blowfish.K[rounds++]; l ^= F(r);
324 l ^= skey->blowfish.K[rounds++]; r ^= F(l);
325 r ^= skey->blowfish.K[rounds++]; l ^= F(r);
326 }
327
328 /* last keying */
329 l ^= skey->blowfish.K[16];
330 r ^= skey->blowfish.K[17];
331
332 *L = r;
333 *R = l;
334 }
335
336 void blowfish_enc(ulong32 *data, unsigned long blocks, const symmetric_key *skey)
337 {
338 unsigned long i;
339 ulong32 *d = data;
340
341 for (i = 0; i < blocks; ++i) {
342 s_blowfish_encipher(d, d + 1, skey);
343 d += 2;
344 }
345 }
346
347 static ulong32 s_blowfish_stream2word(const unsigned char *d, int dlen, int *cur)
348 {
349 unsigned int z;
350 int y = *cur;
351 ulong32 ret = 0;
352
353 for (z = 0; z < 4; z++) {
354 ret = (ret << 8) | ((ulong32)d[y++] & 255);
355 if (y == dlen) {
356 y = 0;
357 }
358 }
359
360 *cur = y;
361 return ret;
362 }
363
297364 /**
298 Initialize the Blowfish block cipher
365 Expand the Blowfish internal state
299366 @param key The symmetric key you wish to pass
300367 @param keylen The key length in bytes
368 @param data The additional data you wish to pass (can be NULL)
369 @param datalen The additional data length in bytes
301370 @param num_rounds The number of rounds desired (0 for default)
302371 @param skey The key in as scheduled by this function.
303372 @return CRYPT_OK if successful
304373 */
305 int blowfish_setup(const unsigned char *key, int keylen, int num_rounds,
306 symmetric_key *skey)
307 {
308 ulong32 x, y, z, A;
309 unsigned char B[8];
374 int blowfish_expand(const unsigned char *key, int keylen,
375 const unsigned char *data, int datalen,
376 symmetric_key *skey)
377 {
378 ulong32 x, y, A, B[2];
379 int i;
310380
311381 LTC_ARGCHK(key != NULL);
312382 LTC_ARGCHK(skey != NULL);
313383
384 /* load in key bytes (Supplied by David Hopwood) */
385 i = 0;
386 for (x = 0; x < 18; x++) {
387 A = s_blowfish_stream2word(key, keylen, &i);
388 skey->blowfish.K[x] ^= A;
389 }
390
391
392 i = 0;
393 B[0] = 0;
394 B[1] = 0;
395 for (x = 0; x < 18; x += 2) {
396 if (data != NULL) {
397 B[0] ^= s_blowfish_stream2word(data, datalen, &i);
398 B[1] ^= s_blowfish_stream2word(data, datalen, &i);
399 }
400 /* encrypt it */
401 s_blowfish_encipher(&B[0], &B[1], skey);
402 /* copy it */
403 skey->blowfish.K[x] = B[0];
404 skey->blowfish.K[x+1] = B[1];
405 }
406
407 /* encrypt S array */
408 for (x = 0; x < 4; x++) {
409 for (y = 0; y < 256; y += 2) {
410 if (data != NULL) {
411 B[0] ^= s_blowfish_stream2word(data, datalen, &i);
412 B[1] ^= s_blowfish_stream2word(data, datalen, &i);
413 }
414 /* encrypt it */
415 s_blowfish_encipher(&B[0], &B[1], skey);
416 /* copy it */
417 skey->blowfish.S[x][y] = B[0];
418 skey->blowfish.S[x][y+1] = B[1];
419 }
420 }
421
422 #ifdef LTC_CLEAN_STACK
423 zeromem(B, sizeof(B));
424 #endif
425
426 return CRYPT_OK;
427 }
428
429 /**
430 Initialize the Blowfish block cipher
431 @param key The symmetric key you wish to pass
432 @param keylen The key length in bytes
433 @param num_rounds The number of rounds desired (0 for default)
434 @param skey The key in as scheduled by this function.
435 @return CRYPT_OK if successful
436 */
437 int blowfish_setup(const unsigned char *key, int keylen, int num_rounds,
438 symmetric_key *skey)
439 {
314440 /* check key length */
315441 if (keylen < 8 || keylen > 56) {
316442 return CRYPT_INVALID_KEYSIZE;
317443 }
318
319444 /* check rounds */
320445 if (num_rounds != 0 && num_rounds != 16) {
321446 return CRYPT_INVALID_ROUNDS;
322447 }
323448
324 /* load in key bytes (Supplied by David Hopwood) */
325 for (x = y = 0; x < 18; x++) {
326 A = 0;
327 for (z = 0; z < 4; z++) {
328 A = (A << 8) | ((ulong32)key[y++] & 255);
329 if (y == (ulong32)keylen) {
330 y = 0;
331 }
332 }
333 skey->blowfish.K[x] = ORIG_P[x] ^ A;
334 }
335
336 /* copy sboxes */
337 for (x = 0; x < 4; x++) {
338 for (y = 0; y < 256; y++) {
339 skey->blowfish.S[x][y] = ORIG_S[x][y];
340 }
341 }
342
343 /* encrypt K array */
344 for (x = 0; x < 8; x++) {
345 B[x] = 0;
346 }
347
348 for (x = 0; x < 18; x += 2) {
349 /* encrypt it */
350 blowfish_ecb_encrypt(B, B, skey);
351 /* copy it */
352 LOAD32H(skey->blowfish.K[x], &B[0]);
353 LOAD32H(skey->blowfish.K[x+1], &B[4]);
354 }
355
356 /* encrypt S array */
357 for (x = 0; x < 4; x++) {
358 for (y = 0; y < 256; y += 2) {
359 /* encrypt it */
360 blowfish_ecb_encrypt(B, B, skey);
361 /* copy it */
362 LOAD32H(skey->blowfish.S[x][y], &B[0]);
363 LOAD32H(skey->blowfish.S[x][y+1], &B[4]);
364 }
365 }
366
367 #ifdef LTC_CLEAN_STACK
368 zeromem(B, sizeof(B));
369 #endif
370
371 return CRYPT_OK;
372 }
373
374 #ifndef __GNUC__
375 #define F(x) ((S1[LTC_BYTE(x,3)] + S2[LTC_BYTE(x,2)]) ^ S3[LTC_BYTE(x,1)]) + S4[LTC_BYTE(x,0)]
376 #else
377 #define F(x) ((skey->blowfish.S[0][LTC_BYTE(x,3)] + skey->blowfish.S[1][LTC_BYTE(x,2)]) ^ skey->blowfish.S[2][LTC_BYTE(x,1)]) + skey->blowfish.S[3][LTC_BYTE(x,0)]
378 #endif
449 return blowfish_setup_with_data(key, keylen, NULL, 0, skey);
450 }
451
452 /**
453 Alternative initialize of the Blowfish block cipher
454 @param key The symmetric key you wish to pass
455 @param keylen The key length in bytes
456 @param data The additional data you wish to pass (can be NULL)
457 @param datalen The additional data length in bytes
458 @param num_rounds The number of rounds desired (0 for default)
459 @param skey The key in as scheduled by this function.
460 @return CRYPT_OK if successful
461 */
462
463 int blowfish_setup_with_data(const unsigned char *key, int keylen,
464 const unsigned char *data, int datalen,
465 symmetric_key *skey)
466 {
467 XMEMCPY(skey->blowfish.K, ORIG_P, sizeof(ORIG_P));
468 XMEMCPY(skey->blowfish.S, ORIG_S, sizeof(ORIG_S));
469 return blowfish_expand(key, keylen, data, datalen, skey);
470 }
379471
380472 /**
381473 Encrypts a block of text with Blowfish
391483 #endif
392484 {
393485 ulong32 L, R;
394 int r;
395 #ifndef __GNUC__
396 const ulong32 *S1, *S2, *S3, *S4;
397 #endif
398
399 LTC_ARGCHK(pt != NULL);
400 LTC_ARGCHK(ct != NULL);
401 LTC_ARGCHK(skey != NULL);
402
403 #ifndef __GNUC__
404 S1 = skey->blowfish.S[0];
405 S2 = skey->blowfish.S[1];
406 S3 = skey->blowfish.S[2];
407 S4 = skey->blowfish.S[3];
408 #endif
486
487 LTC_ARGCHK(pt != NULL);
488 LTC_ARGCHK(ct != NULL);
489 LTC_ARGCHK(skey != NULL);
409490
410491 /* load it */
411492 LOAD32H(L, &pt[0]);
412493 LOAD32H(R, &pt[4]);
413494
414 /* do 16 rounds */
415 for (r = 0; r < 16; ) {
416 L ^= skey->blowfish.K[r++]; R ^= F(L);
417 R ^= skey->blowfish.K[r++]; L ^= F(R);
418 L ^= skey->blowfish.K[r++]; R ^= F(L);
419 R ^= skey->blowfish.K[r++]; L ^= F(R);
420 }
421
422 /* last keying */
423 R ^= skey->blowfish.K[17];
424 L ^= skey->blowfish.K[16];
495 s_blowfish_encipher(&L, &R, skey);
425496
426497 /* store */
427 STORE32H(R, &ct[0]);
428 STORE32H(L, &ct[4]);
498 STORE32H(L, &ct[0]);
499 STORE32H(R, &ct[4]);
429500
430501 return CRYPT_OK;
431502 }
556627 for (y = 0; y < 1000; y++) blowfish_ecb_decrypt(tmp[0], tmp[0], &key);
557628 for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
558629 }
630
631
559632 return CRYPT_OK;
560633 #endif
561634 }
16821682 #ifndef LTC_TEST
16831683 return CRYPT_NOP;
16841684 #else
1685 int err;
16861685 static const struct des_test_case {
1687 int num, mode; /* mode 1 = encrypt */
16881686 unsigned char key[8], txt[8], out[8];
16891687 } cases[] = {
1690 { 1, 1, { 0x10, 0x31, 0x6E, 0x02, 0x8C, 0x8F, 0x3B, 0x4A },
1691 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1692 { 0x82, 0xDC, 0xBA, 0xFB, 0xDE, 0xAB, 0x66, 0x02 } },
1693 { 2, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1694 { 0x95, 0xF8, 0xA5, 0xE5, 0xDD, 0x31, 0xD9, 0x00 },
1695 { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1696 { 3, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1697 { 0xDD, 0x7F, 0x12, 0x1C, 0xA5, 0x01, 0x56, 0x19 },
1698 { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1699 { 4, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1700 { 0x2E, 0x86, 0x53, 0x10, 0x4F, 0x38, 0x34, 0xEA },
1701 { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1702 { 5, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1703 { 0x4B, 0xD3, 0x88, 0xFF, 0x6C, 0xD8, 0x1D, 0x4F },
1704 { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1705 { 6, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1706 { 0x20, 0xB9, 0xE7, 0x67, 0xB2, 0xFB, 0x14, 0x56 },
1707 { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1708 { 7, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1709 { 0x55, 0x57, 0x93, 0x80, 0xD7, 0x71, 0x38, 0xEF },
1710 { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1711 { 8, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1712 { 0x6C, 0xC5, 0xDE, 0xFA, 0xAF, 0x04, 0x51, 0x2F },
1713 { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1714 { 9, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1715 { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 },
1716 { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1717 {10, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1718 { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A },
1719 { 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1720
1721 { 1, 0, { 0x10, 0x31, 0x6E, 0x02, 0x8C, 0x8F, 0x3B, 0x4A },
1722 { 0x82, 0xDC, 0xBA, 0xFB, 0xDE, 0xAB, 0x66, 0x02 },
1723 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1724 { 2, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1725 { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1726 { 0x95, 0xF8, 0xA5, 0xE5, 0xDD, 0x31, 0xD9, 0x00 } },
1727 { 3, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1728 { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1729 { 0xDD, 0x7F, 0x12, 0x1C, 0xA5, 0x01, 0x56, 0x19 } },
1730 { 4, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1731 { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1732 { 0x2E, 0x86, 0x53, 0x10, 0x4F, 0x38, 0x34, 0xEA } },
1733 { 5, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1734 { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1735 { 0x4B, 0xD3, 0x88, 0xFF, 0x6C, 0xD8, 0x1D, 0x4F } },
1736 { 6, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1737 { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1738 { 0x20, 0xB9, 0xE7, 0x67, 0xB2, 0xFB, 0x14, 0x56 } },
1739 { 7, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1740 { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1741 { 0x55, 0x57, 0x93, 0x80, 0xD7, 0x71, 0x38, 0xEF } },
1742 { 8, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1743 { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1744 { 0x6C, 0xC5, 0xDE, 0xFA, 0xAF, 0x04, 0x51, 0x2F } },
1745 { 9, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1746 { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1747 { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 } },
1748 {10, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1749 { 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1750 { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A } },
1751
1752 #ifdef LTC_TEST_EXT
1753 { 0+11, 0, { 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1754 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1755 { 0x95, 0xA8, 0xD7, 0x28, 0x13, 0xDA, 0xA9, 0x4D } },
1756 { 1+11, 0, { 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1757 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1758 { 0x0E, 0xEC, 0x14, 0x87, 0xDD, 0x8C, 0x26, 0xD5 } },
1759 { 2+11, 0, { 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1760 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1761 { 0x7A, 0xD1, 0x6F, 0xFB, 0x79, 0xC4, 0x59, 0x26 } },
1762 { 3+11, 0, { 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1763 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1764 { 0xD3, 0x74, 0x62, 0x94, 0xCA, 0x6A, 0x6C, 0xF3 } },
1765 { 4+11, 0, { 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1766 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1767 { 0x80, 0x9F, 0x5F, 0x87, 0x3C, 0x1F, 0xD7, 0x61 } },
1768 { 5+11, 0, { 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1769 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1770 { 0xC0, 0x2F, 0xAF, 0xFE, 0xC9, 0x89, 0xD1, 0xFC } },
1771 { 6+11, 0, { 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1772 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1773 { 0x46, 0x15, 0xAA, 0x1D, 0x33, 0xE7, 0x2F, 0x10 } },
1774 { 7+11, 0, { 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1775 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1776 { 0x20, 0x55, 0x12, 0x33, 0x50, 0xC0, 0x08, 0x58 } },
1777 { 8+11, 0, { 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1778 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1779 { 0xDF, 0x3B, 0x99, 0xD6, 0x57, 0x73, 0x97, 0xC8 } },
1780 { 9+11, 0, { 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1781 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1782 { 0x31, 0xFE, 0x17, 0x36, 0x9B, 0x52, 0x88, 0xC9 } },
1783 {10+11, 0, { 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1784 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1785 { 0xDF, 0xDD, 0x3C, 0xC6, 0x4D, 0xAE, 0x16, 0x42 } },
1786 {11+11, 0, { 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1787 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1788 { 0x17, 0x8C, 0x83, 0xCE, 0x2B, 0x39, 0x9D, 0x94 } },
1789 {12+11, 0, { 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1790 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1791 { 0x50, 0xF6, 0x36, 0x32, 0x4A, 0x9B, 0x7F, 0x80 } },
1792 {13+11, 0, { 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1793 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1794 { 0xA8, 0x46, 0x8E, 0xE3, 0xBC, 0x18, 0xF0, 0x6D } },
1795 {14+11, 0, { 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01 },
1796 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1797 { 0xA2, 0xDC, 0x9E, 0x92, 0xFD, 0x3C, 0xDE, 0x92 } },
1798 {15+11, 0, { 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01 },
1799 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1800 { 0xCA, 0xC0, 0x9F, 0x79, 0x7D, 0x03, 0x12, 0x87 } },
1801 {16+11, 0, { 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01 },
1802 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1803 { 0x90, 0xBA, 0x68, 0x0B, 0x22, 0xAE, 0xB5, 0x25 } },
1804 {17+11, 0, { 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01 },
1805 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1806 { 0xCE, 0x7A, 0x24, 0xF3, 0x50, 0xE2, 0x80, 0xB6 } },
1807 {18+11, 0, { 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01 },
1808 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1809 { 0x88, 0x2B, 0xFF, 0x0A, 0xA0, 0x1A, 0x0B, 0x87 } },
1810 {19+11, 0, { 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01 },
1811 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1812 { 0x25, 0x61, 0x02, 0x88, 0x92, 0x45, 0x11, 0xC2 } },
1813 {20+11, 0, { 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01 },
1814 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1815 { 0xC7, 0x15, 0x16, 0xC2, 0x9C, 0x75, 0xD1, 0x70 } },
1816 {21+11, 0, { 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01 },
1817 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1818 { 0x51, 0x99, 0xC2, 0x9A, 0x52, 0xC9, 0xF0, 0x59 } },
1819 {22+11, 0, { 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01 },
1820 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1821 { 0xC2, 0x2F, 0x0A, 0x29, 0x4A, 0x71, 0xF2, 0x9F } },
1822 {23+11, 0, { 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01 },
1823 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1824 { 0xEE, 0x37, 0x14, 0x83, 0x71, 0x4C, 0x02, 0xEA } },
1825 {24+11, 0, { 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01 },
1826 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1827 { 0xA8, 0x1F, 0xBD, 0x44, 0x8F, 0x9E, 0x52, 0x2F } },
1828 {25+11, 0, { 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01 },
1829 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1830 { 0x4F, 0x64, 0x4C, 0x92, 0xE1, 0x92, 0xDF, 0xED } },
1831 {26+11, 0, { 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01 },
1832 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1833 { 0x1A, 0xFA, 0x9A, 0x66, 0xA6, 0xDF, 0x92, 0xAE } },
1834 {27+11, 0, { 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01 },
1835 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1836 { 0xB3, 0xC1, 0xCC, 0x71, 0x5C, 0xB8, 0x79, 0xD8 } },
1837 {28+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01 },
1838 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1839 { 0x19, 0xD0, 0x32, 0xE6, 0x4A, 0xB0, 0xBD, 0x8B } },
1840 {29+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01 },
1841 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1842 { 0x3C, 0xFA, 0xA7, 0xA7, 0xDC, 0x87, 0x20, 0xDC } },
1843 {30+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01 },
1844 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1845 { 0xB7, 0x26, 0x5F, 0x7F, 0x44, 0x7A, 0xC6, 0xF3 } },
1846 {31+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01 },
1847 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1848 { 0x9D, 0xB7, 0x3B, 0x3C, 0x0D, 0x16, 0x3F, 0x54 } },
1849 {32+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01 },
1850 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1851 { 0x81, 0x81, 0xB6, 0x5B, 0xAB, 0xF4, 0xA9, 0x75 } },
1852 {33+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01 },
1853 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1854 { 0x93, 0xC9, 0xB6, 0x40, 0x42, 0xEA, 0xA2, 0x40 } },
1855 {34+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01 },
1856 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1857 { 0x55, 0x70, 0x53, 0x08, 0x29, 0x70, 0x55, 0x92 } },
1858 {35+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01 },
1859 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1860 { 0x86, 0x38, 0x80, 0x9E, 0x87, 0x87, 0x87, 0xA0 } },
1861 {36+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01 },
1862 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1863 { 0x41, 0xB9, 0xA7, 0x9A, 0xF7, 0x9A, 0xC2, 0x08 } },
1864 {37+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01 },
1865 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1866 { 0x7A, 0x9B, 0xE4, 0x2F, 0x20, 0x09, 0xA8, 0x92 } },
1867 {38+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01 },
1868 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1869 { 0x29, 0x03, 0x8D, 0x56, 0xBA, 0x6D, 0x27, 0x45 } },
1870 {39+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01 },
1871 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1872 { 0x54, 0x95, 0xC6, 0xAB, 0xF1, 0xE5, 0xDF, 0x51 } },
1873 {40+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01 },
1874 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1875 { 0xAE, 0x13, 0xDB, 0xD5, 0x61, 0x48, 0x89, 0x33 } },
1876 {41+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01 },
1877 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1878 { 0x02, 0x4D, 0x1F, 0xFA, 0x89, 0x04, 0xE3, 0x89 } },
1879 {42+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01 },
1880 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1881 { 0xD1, 0x39, 0x97, 0x12, 0xF9, 0x9B, 0xF0, 0x2E } },
1882 {43+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01 },
1883 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1884 { 0x14, 0xC1, 0xD7, 0xC1, 0xCF, 0xFE, 0xC7, 0x9E } },
1885 {44+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01 },
1886 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1887 { 0x1D, 0xE5, 0x27, 0x9D, 0xAE, 0x3B, 0xED, 0x6F } },
1888 {45+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01 },
1889 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1890 { 0xE9, 0x41, 0xA3, 0x3F, 0x85, 0x50, 0x13, 0x03 } },
1891 {46+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01 },
1892 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1893 { 0xDA, 0x99, 0xDB, 0xBC, 0x9A, 0x03, 0xF3, 0x79 } },
1894 {47+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01 },
1895 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1896 { 0xB7, 0xFC, 0x92, 0xF9, 0x1D, 0x8E, 0x92, 0xE9 } },
1897 {48+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01 },
1898 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1899 { 0xAE, 0x8E, 0x5C, 0xAA, 0x3C, 0xA0, 0x4E, 0x85 } },
1900 {49+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80 },
1901 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1902 { 0x9C, 0xC6, 0x2D, 0xF4, 0x3B, 0x6E, 0xED, 0x74 } },
1903 {50+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40 },
1904 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1905 { 0xD8, 0x63, 0xDB, 0xB5, 0xC5, 0x9A, 0x91, 0xA0 } },
1906 {51+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20 },
1907 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1908 { 0xA1, 0xAB, 0x21, 0x90, 0x54, 0x5B, 0x91, 0xD7 } },
1909 {52+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10 },
1910 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1911 { 0x08, 0x75, 0x04, 0x1E, 0x64, 0xC5, 0x70, 0xF7 } },
1912 {53+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08 },
1913 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1914 { 0x5A, 0x59, 0x45, 0x28, 0xBE, 0xBE, 0xF1, 0xCC } },
1915 {54+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04 },
1916 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1917 { 0xFC, 0xDB, 0x32, 0x91, 0xDE, 0x21, 0xF0, 0xC0 } },
1918 {55+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02 },
1919 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1920 { 0x86, 0x9E, 0xFD, 0x7F, 0x9F, 0x26, 0x5A, 0x09 } },
1921 #endif /* LTC_TEST_EXT */
1688 { { 0x10, 0x31, 0x6E, 0x02, 0x8C, 0x8F, 0x3B, 0x4A },
1689 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1690 { 0x82, 0xDC, 0xBA, 0xFB, 0xDE, 0xAB, 0x66, 0x02 } },
1691 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1692 { 0x95, 0xF8, 0xA5, 0xE5, 0xDD, 0x31, 0xD9, 0x00 },
1693 { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1694 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1695 { 0xDD, 0x7F, 0x12, 0x1C, 0xA5, 0x01, 0x56, 0x19 },
1696 { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1697 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1698 { 0x2E, 0x86, 0x53, 0x10, 0x4F, 0x38, 0x34, 0xEA },
1699 { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1700 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1701 { 0x4B, 0xD3, 0x88, 0xFF, 0x6C, 0xD8, 0x1D, 0x4F },
1702 { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1703 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1704 { 0x20, 0xB9, 0xE7, 0x67, 0xB2, 0xFB, 0x14, 0x56 },
1705 { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1706 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1707 { 0x55, 0x57, 0x93, 0x80, 0xD7, 0x71, 0x38, 0xEF },
1708 { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1709 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1710 { 0x6C, 0xC5, 0xDE, 0xFA, 0xAF, 0x04, 0x51, 0x2F },
1711 { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1712 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1713 { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 },
1714 { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1715 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1716 { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A },
1717 { 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1718
1719 { { 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1720 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1721 { 0x95, 0xA8, 0xD7, 0x28, 0x13, 0xDA, 0xA9, 0x4D } },
1722 { { 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1723 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1724 { 0x0E, 0xEC, 0x14, 0x87, 0xDD, 0x8C, 0x26, 0xD5 } },
1725 { { 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1726 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1727 { 0x7A, 0xD1, 0x6F, 0xFB, 0x79, 0xC4, 0x59, 0x26 } },
1728 { { 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1729 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1730 { 0xD3, 0x74, 0x62, 0x94, 0xCA, 0x6A, 0x6C, 0xF3 } },
1731 { { 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1732 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1733 { 0x80, 0x9F, 0x5F, 0x87, 0x3C, 0x1F, 0xD7, 0x61 } },
1734 { { 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1735 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1736 { 0xC0, 0x2F, 0xAF, 0xFE, 0xC9, 0x89, 0xD1, 0xFC } },
1737 { { 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1738 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1739 { 0x46, 0x15, 0xAA, 0x1D, 0x33, 0xE7, 0x2F, 0x10 } },
1740 { { 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1741 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1742 { 0x20, 0x55, 0x12, 0x33, 0x50, 0xC0, 0x08, 0x58 } },
1743 { { 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1744 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1745 { 0xDF, 0x3B, 0x99, 0xD6, 0x57, 0x73, 0x97, 0xC8 } },
1746 { { 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1747 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1748 { 0x31, 0xFE, 0x17, 0x36, 0x9B, 0x52, 0x88, 0xC9 } },
1749 { { 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1750 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1751 { 0xDF, 0xDD, 0x3C, 0xC6, 0x4D, 0xAE, 0x16, 0x42 } },
1752 { { 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1753 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1754 { 0x17, 0x8C, 0x83, 0xCE, 0x2B, 0x39, 0x9D, 0x94 } },
1755 { { 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1756 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1757 { 0x50, 0xF6, 0x36, 0x32, 0x4A, 0x9B, 0x7F, 0x80 } },
1758 { { 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1759 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1760 { 0xA8, 0x46, 0x8E, 0xE3, 0xBC, 0x18, 0xF0, 0x6D } },
1761 { { 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01 },
1762 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1763 { 0xA2, 0xDC, 0x9E, 0x92, 0xFD, 0x3C, 0xDE, 0x92 } },
1764 { { 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01 },
1765 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1766 { 0xCA, 0xC0, 0x9F, 0x79, 0x7D, 0x03, 0x12, 0x87 } },
1767 { { 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01 },
1768 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1769 { 0x90, 0xBA, 0x68, 0x0B, 0x22, 0xAE, 0xB5, 0x25 } },
1770 { { 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01 },
1771 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1772 { 0xCE, 0x7A, 0x24, 0xF3, 0x50, 0xE2, 0x80, 0xB6 } },
1773 { { 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01 },
1774 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1775 { 0x88, 0x2B, 0xFF, 0x0A, 0xA0, 0x1A, 0x0B, 0x87 } },
1776 { { 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01 },
1777 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1778 { 0x25, 0x61, 0x02, 0x88, 0x92, 0x45, 0x11, 0xC2 } },
1779 { { 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01 },
1780 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1781 { 0xC7, 0x15, 0x16, 0xC2, 0x9C, 0x75, 0xD1, 0x70 } },
1782 { { 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01 },
1783 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1784 { 0x51, 0x99, 0xC2, 0x9A, 0x52, 0xC9, 0xF0, 0x59 } },
1785 { { 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01 },
1786 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1787 { 0xC2, 0x2F, 0x0A, 0x29, 0x4A, 0x71, 0xF2, 0x9F } },
1788 { { 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01 },
1789 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1790 { 0xEE, 0x37, 0x14, 0x83, 0x71, 0x4C, 0x02, 0xEA } },
1791 { { 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01 },
1792 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1793 { 0xA8, 0x1F, 0xBD, 0x44, 0x8F, 0x9E, 0x52, 0x2F } },
1794 { { 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01 },
1795 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1796 { 0x4F, 0x64, 0x4C, 0x92, 0xE1, 0x92, 0xDF, 0xED } },
1797 { { 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01 },
1798 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1799 { 0x1A, 0xFA, 0x9A, 0x66, 0xA6, 0xDF, 0x92, 0xAE } },
1800 { { 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01 },
1801 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1802 { 0xB3, 0xC1, 0xCC, 0x71, 0x5C, 0xB8, 0x79, 0xD8 } },
1803 { { 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01 },
1804 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1805 { 0x19, 0xD0, 0x32, 0xE6, 0x4A, 0xB0, 0xBD, 0x8B } },
1806 { { 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01 },
1807 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1808 { 0x3C, 0xFA, 0xA7, 0xA7, 0xDC, 0x87, 0x20, 0xDC } },
1809 { { 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01 },
1810 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1811 { 0xB7, 0x26, 0x5F, 0x7F, 0x44, 0x7A, 0xC6, 0xF3 } },
1812 { { 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01 },
1813 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1814 { 0x9D, 0xB7, 0x3B, 0x3C, 0x0D, 0x16, 0x3F, 0x54 } },
1815 { { 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01 },
1816 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1817 { 0x81, 0x81, 0xB6, 0x5B, 0xAB, 0xF4, 0xA9, 0x75 } },
1818 { { 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01 },
1819 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1820 { 0x93, 0xC9, 0xB6, 0x40, 0x42, 0xEA, 0xA2, 0x40 } },
1821 { { 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01 },
1822 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1823 { 0x55, 0x70, 0x53, 0x08, 0x29, 0x70, 0x55, 0x92 } },
1824 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01 },
1825 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1826 { 0x86, 0x38, 0x80, 0x9E, 0x87, 0x87, 0x87, 0xA0 } },
1827 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01 },
1828 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1829 { 0x41, 0xB9, 0xA7, 0x9A, 0xF7, 0x9A, 0xC2, 0x08 } },
1830 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01 },
1831 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1832 { 0x7A, 0x9B, 0xE4, 0x2F, 0x20, 0x09, 0xA8, 0x92 } },
1833 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01 },
1834 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1835 { 0x29, 0x03, 0x8D, 0x56, 0xBA, 0x6D, 0x27, 0x45 } },
1836 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01 },
1837 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1838 { 0x54, 0x95, 0xC6, 0xAB, 0xF1, 0xE5, 0xDF, 0x51 } },
1839 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01 },
1840 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1841 { 0xAE, 0x13, 0xDB, 0xD5, 0x61, 0x48, 0x89, 0x33 } },
1842 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01 },
1843 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1844 { 0x02, 0x4D, 0x1F, 0xFA, 0x89, 0x04, 0xE3, 0x89 } },
1845 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01 },
1846 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1847 { 0xD1, 0x39, 0x97, 0x12, 0xF9, 0x9B, 0xF0, 0x2E } },
1848 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01 },
1849 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1850 { 0x14, 0xC1, 0xD7, 0xC1, 0xCF, 0xFE, 0xC7, 0x9E } },
1851 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01 },
1852 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1853 { 0x1D, 0xE5, 0x27, 0x9D, 0xAE, 0x3B, 0xED, 0x6F } },
1854 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01 },
1855 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1856 { 0xE9, 0x41, 0xA3, 0x3F, 0x85, 0x50, 0x13, 0x03 } },
1857 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01 },
1858 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1859 { 0xDA, 0x99, 0xDB, 0xBC, 0x9A, 0x03, 0xF3, 0x79 } },
1860 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01 },
1861 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1862 { 0xB7, 0xFC, 0x92, 0xF9, 0x1D, 0x8E, 0x92, 0xE9 } },
1863 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01 },
1864 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1865 { 0xAE, 0x8E, 0x5C, 0xAA, 0x3C, 0xA0, 0x4E, 0x85 } },
1866 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80 },
1867 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1868 { 0x9C, 0xC6, 0x2D, 0xF4, 0x3B, 0x6E, 0xED, 0x74 } },
1869 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40 },
1870 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1871 { 0xD8, 0x63, 0xDB, 0xB5, 0xC5, 0x9A, 0x91, 0xA0 } },
1872 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20 },
1873 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1874 { 0xA1, 0xAB, 0x21, 0x90, 0x54, 0x5B, 0x91, 0xD7 } },
1875 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10 },
1876 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1877 { 0x08, 0x75, 0x04, 0x1E, 0x64, 0xC5, 0x70, 0xF7 } },
1878 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08 },
1879 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1880 { 0x5A, 0x59, 0x45, 0x28, 0xBE, 0xBE, 0xF1, 0xCC } },
1881 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04 },
1882 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1883 { 0xFC, 0xDB, 0x32, 0x91, 0xDE, 0x21, 0xF0, 0xC0 } },
1884 { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02 },
1885 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1886 { 0x86, 0x9E, 0xFD, 0x7F, 0x9F, 0x26, 0x5A, 0x09 } },
19221887
19231888 /*** more test cases you could add if you are not convinced (the above test cases aren't really too good):
19241889
19611926 http://www.ecs.soton.ac.uk/~prw99r/ez438/vectors.txt
19621927 ***/
19631928 };
1964 int i, y;
1965 unsigned char tmp[8];
1966 symmetric_key des;
1967
1968 for(i=0; i < (int)(sizeof(cases)/sizeof(cases[0])); i++)
1929 unsigned char key[8], pt[8], ct[8], tmp[8];
1930 symmetric_key skey;
1931 int i, err;
1932
1933 for (i = 0; i < (int)(sizeof(cases)/sizeof(cases[0])); i++)
19691934 {
1970 if ((err = des_setup(cases[i].key, 8, 0, &des)) != CRYPT_OK) {
1971 return err;
1935 if ((err = des_setup(cases[i].key, 8, 0, &skey)) != CRYPT_OK) {
1936 return err;
19721937 }
1973 if (cases[i].mode != 0) {
1974 des_ecb_encrypt(cases[i].txt, tmp, &des);
1975 } else {
1976 des_ecb_decrypt(cases[i].txt, tmp, &des);
1938
1939 des_ecb_encrypt(cases[i].txt, ct, &skey);
1940
1941 if (compare_testvector(ct, sizeof(ct), cases[i].out, 8, "DES Encrypt", i) != 0) {
1942 return CRYPT_FAIL_TESTVECTOR;
19771943 }
19781944
1979 if (compare_testvector(cases[i].out, sizeof(tmp), tmp, sizeof(tmp), "DES", i) != 0) {
1980 return CRYPT_FAIL_TESTVECTOR;
1945 des_ecb_decrypt(ct, pt, &skey);
1946
1947 if (compare_testvector(pt, sizeof(pt), cases[i].txt, 8, "DES Decrypt", i) != 0) {
1948 return CRYPT_FAIL_TESTVECTOR;
19811949 }
1982
1983 /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
1984 for (y = 0; y < 8; y++) tmp[y] = 0;
1985 for (y = 0; y < 1000; y++) des_ecb_encrypt(tmp, tmp, &des);
1986 for (y = 0; y < 1000; y++) des_ecb_decrypt(tmp, tmp, &des);
1987 for (y = 0; y < 8; y++) if (tmp[y] != 0) return CRYPT_FAIL_TESTVECTOR;
1950 }
1951
1952 /* See if we can encrypt all zero bytes 1000 times, decrypt and come back to where we started */
1953
1954 for (i = 0; i < 8; i++) key[i] = i;
1955
1956 if ((err = des_setup(key, 8, 0, &skey)) != CRYPT_OK) {
1957 return err;
1958 }
1959
1960 for (i = 0; i < 8; i++) pt[i] = tmp[i] = 0;
1961 for (i = 0; i < 1000; i++) des_ecb_encrypt(tmp, tmp, &skey);
1962 for (i = 0; i < 1000; i++) des_ecb_decrypt(tmp, tmp, &skey);
1963
1964 if (compare_testvector(tmp, 8, pt, 8, "DES", 0) != 0) {
1965 return CRYPT_FAIL_TESTVECTOR;
19881966 }
19891967
19901968 return CRYPT_OK;
19961974 #ifndef LTC_TEST
19971975 return CRYPT_NOP;
19981976 #else
1999 unsigned char key[24], pt[8], ct[8], tmp[8];
2000 symmetric_key skey;
2001 int x, err;
2002
2003 if ((err = des_test()) != CRYPT_OK) {
2004 return err;
2005 }
2006
2007 for (x = 0; x < 8; x++) {
2008 pt[x] = x;
2009 }
2010
2011 for (x = 0; x < 24; x++) {
2012 key[x] = x;
2013 }
2014
2015 if ((err = des3_setup(key, 24, 0, &skey)) != CRYPT_OK) {
2016 return err;
2017 }
2018
2019 des3_ecb_encrypt(pt, ct, &skey);
2020 des3_ecb_decrypt(ct, tmp, &skey);
2021
2022 if (compare_testvector(pt, 8, tmp, 8, "3DES", 0) != 0) {
2023 return CRYPT_FAIL_TESTVECTOR;
2024 }
2025
2026 return CRYPT_OK;
1977 static const struct des3_test_case {
1978 unsigned char key[16], txt[8], out[8];
1979 } cases[] = {
1980 /*
1981 https://www.cosic.esat.kuleuven.be/nessie/testvectors/bc/des/Triple-Des-2-Key-128-64.unverified.test-vectors
1982 */
1983 { { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1984 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1985 { 0xFA, 0xFD, 0x50, 0x84, 0x37, 0x4F, 0xCE, 0x34 } },
1986 { { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1987 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1988 { 0x60, 0xCC, 0x37, 0xB7, 0xB5, 0x37, 0xA1, 0xDC } },
1989 { { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1990 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1991 { 0xBE, 0x3E, 0x73, 0x04, 0xFE, 0x92, 0xC2, 0xBC } },
1992 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
1993 { 0xE5, 0xA9, 0xE3, 0x80, 0x03, 0xA5, 0xA0, 0xFD },
1994 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
1995 { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F },
1996 { 0xE4, 0xFC, 0x19, 0xD6, 0x94, 0x63, 0xB7, 0x83 },
1997 { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 } },
1998 };
1999 unsigned char key[24], pt[8], ct[8], tmp[8];
2000 symmetric_key skey;
2001 int i, err;
2002
2003 if ((err = des_test()) != CRYPT_OK) {
2004 return err;
2005 }
2006
2007 for (i = 0; i < (int)(sizeof(cases)/sizeof(cases[0])); i++)
2008 {
2009 if ((err = des3_setup(cases[i].key, 16, 0, &skey)) != CRYPT_OK) {
2010 return err;
2011 }
2012
2013 des3_ecb_encrypt(cases[i].txt, ct, &skey);
2014
2015 if (compare_testvector(ct, sizeof(ct), cases[i].out, 8, "3DES Encrypt", i) != 0) {
2016 return CRYPT_FAIL_TESTVECTOR;
2017 }
2018
2019 des3_ecb_decrypt(ct, pt, &skey);
2020
2021 if (compare_testvector(pt, sizeof(pt), cases[i].txt, 8, "3DES Decrypt", i) != 0) {
2022 return CRYPT_FAIL_TESTVECTOR;
2023 }
2024 }
2025
2026 /* See if we can encrypt all zero bytes 1000 times, decrypt and come back to where we started */
2027
2028 for (i = 0; i < 24; i++) key[i] = i;
2029
2030 if ((err = des3_setup(key, 24, 0, &skey)) != CRYPT_OK) {
2031 return err;
2032 }
2033
2034 for (i = 0; i < 8; i++) pt[i] = tmp[i] = 0;
2035 for (i = 0; i < 1000; i++) des3_ecb_encrypt(tmp, tmp, &skey);
2036 for (i = 0; i < 1000; i++) des3_ecb_decrypt(tmp, tmp, &skey);
2037
2038 if (compare_testvector(tmp, 8, pt, 8, "3DES", 0) != 0) {
2039 return CRYPT_FAIL_TESTVECTOR;
2040 }
2041
2042 return CRYPT_OK;
20272043 #endif
20282044 }
20292045
135135 LTC_ARGCHK(pt != NULL);
136136 LTC_ARGCHK(ct != NULL);
137137
138 if (skey->rc5.rounds < 12 || skey->rc5.rounds > 24) {
139 return CRYPT_INVALID_ROUNDS;
140 }
141
138142 LOAD32L(A, &pt[0]);
139143 LOAD32L(B, &pt[4]);
140144 A += skey->rc5.K[0];
190194 LTC_ARGCHK(skey != NULL);
191195 LTC_ARGCHK(pt != NULL);
192196 LTC_ARGCHK(ct != NULL);
197
198 if (skey->rc5.rounds < 12 || skey->rc5.rounds > 24) {
199 return CRYPT_INVALID_ROUNDS;
200 }
193201
194202 LOAD32L(A, &ct[0]);
195203 LOAD32L(B, &ct[4]);
346346 LTC_ARGCHK(ct != NULL);
347347 LTC_ARGCHK(skey != NULL);
348348
349 if (skey->saferp.rounds < 8 || skey->saferp.rounds > 16) {
350 return CRYPT_INVALID_ROUNDS;
351 }
352
349353 /* do eight rounds */
350354 for (x = 0; x < 16; x++) {
351355 b[x] = pt[x];
409413 LTC_ARGCHK(pt != NULL);
410414 LTC_ARGCHK(ct != NULL);
411415 LTC_ARGCHK(skey != NULL);
416
417 if (skey->saferp.rounds < 8 || skey->saferp.rounds > 16) {
418 return CRYPT_INVALID_ROUNDS;
419 }
412420
413421 /* do eight rounds */
414422 b[0] = ct[0] ^ skey->saferp.K[skey->saferp.rounds*2][0];
0 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
1 *
2 * LibTomCrypt is a library that provides various cryptographic
3 * algorithms in a highly modular and flexible manner.
4 *
5 * The library is free for all purposes without any express
6 * guarantee it works.
7 */
8
9 /**
10 @file tea.c
11 Implementation of TEA, Steffen Jaeckel
12 */
13 #include "tomcrypt_private.h"
14
15 #ifdef LTC_TEA
16
17 const struct ltc_cipher_descriptor tea_desc =
18 {
19 "tea",
20 26,
21 16, 16, 8, 32,
22 &tea_setup,
23 &tea_ecb_encrypt,
24 &tea_ecb_decrypt,
25 &tea_test,
26 &tea_done,
27 &tea_keysize,
28 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
29 };
30
31 #define DELTA 0x9E3779B9uL
32 #define SUM 0xC6EF3720uL
33
34 int tea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
35 {
36 LTC_ARGCHK(key != NULL);
37 LTC_ARGCHK(skey != NULL);
38
39 /* check arguments */
40 if (keylen != 16) {
41 return CRYPT_INVALID_KEYSIZE;
42 }
43
44 if (num_rounds != 0 && num_rounds != 32) {
45 return CRYPT_INVALID_ROUNDS;
46 }
47
48 /* load key */
49 LOAD32H(skey->tea.k[0], key+0);
50 LOAD32H(skey->tea.k[1], key+4);
51 LOAD32H(skey->tea.k[2], key+8);
52 LOAD32H(skey->tea.k[3], key+12);
53
54 return CRYPT_OK;
55 }
56
57 /**
58 Encrypts a block of text with TEA
59 @param pt The input plaintext (8 bytes)
60 @param ct The output ciphertext (8 bytes)
61 @param skey The key as scheduled
62 @return CRYPT_OK if successful
63 */
64 int tea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
65 {
66 ulong32 y, z, sum = 0;
67 const ulong32 delta = DELTA;
68 int r;
69
70 LTC_ARGCHK(pt != NULL);
71 LTC_ARGCHK(ct != NULL);
72 LTC_ARGCHK(skey != NULL);
73
74 LOAD32H(y, &pt[0]);
75 LOAD32H(z, &pt[4]);
76 for (r = 0; r < 32; r += 4) {
77 sum += delta;
78 y += ((z<<4) + skey->tea.k[0]) ^ (z + sum) ^ ((z>>5) + skey->tea.k[1]);
79 z += ((y<<4) + skey->tea.k[2]) ^ (y + sum) ^ ((y>>5) + skey->tea.k[3]);
80 }
81 STORE32H(y, &ct[0]);
82 STORE32H(z, &ct[4]);
83 return CRYPT_OK;
84 }
85
86 /**
87 Decrypts a block of text with TEA
88 @param ct The input ciphertext (8 bytes)
89 @param pt The output plaintext (8 bytes)
90 @param skey The key as scheduled
91 @return CRYPT_OK if successful
92 */
93 int tea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
94 {
95 ulong32 v0, v1, sum = SUM;
96 const ulong32 delta = DELTA;
97 int r;
98
99 LTC_ARGCHK(pt != NULL);
100 LTC_ARGCHK(ct != NULL);
101 LTC_ARGCHK(skey != NULL);
102
103 LOAD32H(v0, &ct[0]);
104 LOAD32H(v1, &ct[4]);
105
106 for (r = 0; r < 32; r++) {
107 v1 -= ((v0 << 4) + skey->tea.k[2]) ^ (v0 + sum) ^ ((v0 >> 5) + skey->tea.k[3]);
108 v0 -= ((v1 << 4) + skey->tea.k[0]) ^ (v1 + sum) ^ ((v1 >> 5) + skey->tea.k[1]);
109 sum -= delta;
110 }
111
112 STORE32H(v0, &pt[0]);
113 STORE32H(v1, &pt[4]);
114 return CRYPT_OK;
115 }
116
117 /**
118 Performs a self-test of the TEA block cipher
119 @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
120 */
121 int tea_test(void)
122 {
123 #ifndef LTC_TEST
124 return CRYPT_NOP;
125 #else
126 static const struct {
127 const char *key, *pt, *ct;
128 } tests[] = {
129 {
130 "00000000000000000000000000000000",
131 "0000000000000000",
132 "41ea3a0a94baa940"
133 }, {
134 "32a1e65408b63bb9214105744ec5d2e2",
135 "5ada1d89a9c3801a",
136 "dd46249e28aa0b4b"
137 }, {
138 "60388adadf70a1f5d9cb4e097d2c6c57",
139 "7a6adb4d69c53e0f",
140 "44b71215cf25368a"
141 }, {
142 "4368d2249bd0321eb7c56d5b63a1bfac",
143 "5a5d7ca2e186c41a",
144 "91f56dff7281794f"
145 }, {
146 "5c60bff27072d01c4513c5eb8f3a38ab",
147 "80d9c4adcf899635",
148 "2bb0f1b3c023ed11"
149 }
150 };
151 unsigned char ptct[2][8];
152 unsigned char tmp[2][8];
153 unsigned char key[16];
154 unsigned long l;
155 symmetric_key skey;
156 size_t i;
157 int err, y;
158 for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {
159 zeromem(&skey, sizeof(skey));
160
161 l = sizeof(key);
162 if ((err = base16_decode(tests[i].key, XSTRLEN(tests[i].key), key, &l)) != CRYPT) return err;
163 l = sizeof(ptct[0]);
164 if ((err = base16_decode(tests[i].pt, XSTRLEN(tests[i].pt), ptct[0], &l)) != CRYPT) return err;
165 l = sizeof(ptct[1]);
166 if ((err = base16_decode(tests[i].ct, XSTRLEN(tests[i].ct), ptct[1], &l)) != CRYPT) return err;
167
168 if ((err = tea_setup(key, 16, 0, &skey)) != CRYPT_OK) {
169 return err;
170 }
171 tea_ecb_encrypt(ptct[0], tmp[0], &skey);
172 tea_ecb_decrypt(tmp[0], tmp[1], &skey);
173
174 if (compare_testvector(tmp[0], 8, ptct[0], 8, "TEA Encrypt", i) != 0 ||
175 compare_testvector(tmp[1], 8, ptct[1], 8, "TEA Decrypt", i) != 0) {
176 return CRYPT_FAIL_TESTVECTOR;
177 }
178
179 /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
180 for (y = 0; y < 8; y++) tmp[0][y] = 0;
181 for (y = 0; y < 1000; y++) tea_ecb_encrypt(tmp[0], tmp[0], &skey);
182 for (y = 0; y < 1000; y++) tea_ecb_decrypt(tmp[0], tmp[0], &skey);
183 for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
184 } /* for */
185
186 return CRYPT_OK;
187 #endif
188 }
189
190 /** Terminate the context
191 @param skey The scheduled key
192 */
193 void tea_done(symmetric_key *skey)
194 {
195 LTC_UNUSED_PARAM(skey);
196 }
197
198 /**
199 Gets suitable key size
200 @param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
201 @return CRYPT_OK if the input key size is acceptable.
202 */
203 int tea_keysize(int *keysize)
204 {
205 LTC_ARGCHK(keysize != NULL);
206 if (*keysize < 16) {
207 return CRYPT_INVALID_KEYSIZE;
208 }
209 *keysize = 16;
210 return CRYPT_OK;
211 }
212
213 #endif
214
215
216 /* ref: $Format:%D$ */
217 /* git commit: $Format:%H$ */
218 /* commit time: $Format:%ai$ */
88
99 /**
1010 @file xtea.c
11 Implementation of LTC_XTEA, Tom St Denis
11 Implementation of eXtended TEA, Tom St Denis
1212 */
1313 #include "tomcrypt_private.h"
1414
1212 */
1313 #include "tomcrypt_private.h"
1414
15 #if defined(LTC_GCM_TABLES) || defined(LTC_LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST))
15 #if defined(LTC_GCM_TABLES) || defined(LTC_LRW_TABLES) || (defined(LTC_GCM_MODE) && defined(LTC_FAST))
1616
1717 /* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the
1818 * lower 16 bits are not zero'ed I removed the upper 14 bytes */
479479
480480 for (i = 0; tests[i].msg != NULL; i++) {
481481 blake2b_512_init(&md);
482 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
482 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
483483 blake2b_done(&md, tmp);
484484 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) {
485485 return CRYPT_FAIL_TESTVECTOR;
526526
527527 for (i = 0; tests[i].msg != NULL; i++) {
528528 blake2b_384_init(&md);
529 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
529 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
530530 blake2b_done(&md, tmp);
531531 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) {
532532 return CRYPT_FAIL_TESTVECTOR;
579579
580580 for (i = 0; tests[i].msg != NULL; i++) {
581581 blake2b_256_init(&md);
582 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
582 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
583583 blake2b_done(&md, tmp);
584584 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) {
585585 return CRYPT_FAIL_TESTVECTOR;
620620
621621 for (i = 0; tests[i].msg != NULL; i++) {
622622 blake2b_160_init(&md);
623 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
623 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
624624 blake2b_done(&md, tmp);
625625 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_160", i)) {
626626 return CRYPT_FAIL_TESTVECTOR;
469469
470470 for (i = 0; tests[i].msg != NULL; i++) {
471471 blake2s_256_init(&md);
472 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
472 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
473473 blake2s_done(&md, tmp);
474474 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) {
475475 return CRYPT_FAIL_TESTVECTOR;
513513
514514 for (i = 0; tests[i].msg != NULL; i++) {
515515 blake2s_224_init(&md);
516 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
516 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
517517 blake2s_done(&md, tmp);
518518 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) {
519519 return CRYPT_FAIL_TESTVECTOR;
555555
556556 for (i = 0; tests[i].msg != NULL; i++) {
557557 blake2s_160_init(&md);
558 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
558 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
559559 blake2s_done(&md, tmp);
560560 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) {
561561 return CRYPT_FAIL_TESTVECTOR;
595595
596596 for (i = 0; tests[i].msg != NULL; i++) {
597597 blake2s_128_init(&md);
598 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
598 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
599599 blake2s_done(&md, tmp);
600600 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_128", i)) {
601601 return CRYPT_FAIL_TESTVECTOR;
269269 16
270270 }
271271 };
272 int i, oldhashidx, idx;
272 int i, oldhashidx, idx, err;
273273 unsigned char tmp[MAXBLOCKSIZE];
274274 hash_state md;
275275
283283 chc_register(idx);
284284
285285 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
286 chc_init(&md);
287 chc_process(&md, tests[i].msg, strlen((char *)tests[i].msg));
288 chc_done(&md, tmp);
286 if ((err = chc_init(&md)) != CRYPT_OK) {
287 return err;
288 }
289 if ((err = chc_process(&md, tests[i].msg, XSTRLEN((char *)tests[i].msg))) != CRYPT_OK) {
290 return err;
291 }
292 if ((err = chc_done(&md, tmp)) != CRYPT_OK) {
293 return err;
294 }
289295 if (compare_testvector(tmp, tests[i].len, tests[i].hash, tests[i].len, "CHC", i)) {
290296 return CRYPT_FAIL_TESTVECTOR;
291297 }
231231
232232 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
233233 md2_init(&md);
234 md2_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
234 md2_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
235235 md2_done(&md, tmp);
236236 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD2", i)) {
237237 return CRYPT_FAIL_TESTVECTOR;
285285
286286 for(i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
287287 md4_init(&md);
288 md4_process(&md, (unsigned char *)tests[i].input, (unsigned long)strlen(tests[i].input));
288 md4_process(&md, (unsigned char *)tests[i].input, (unsigned long)XSTRLEN(tests[i].input));
289289 md4_done(&md, tmp);
290290 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD4", i)) {
291291 return CRYPT_FAIL_TESTVECTOR;
346346
347347 for (i = 0; tests[i].msg != NULL; i++) {
348348 md5_init(&md);
349 md5_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
349 md5_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
350350 md5_done(&md, tmp);
351351 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD5", i)) {
352352 return CRYPT_FAIL_TESTVECTOR;
387387
388388 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
389389 rmd128_init(&md);
390 rmd128_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg));
390 rmd128_process(&md, (unsigned char *)tests[i].msg, XSTRLEN(tests[i].msg));
391391 rmd128_done(&md, tmp);
392392 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD128", i)) {
393393 return CRYPT_FAIL_TESTVECTOR;
446446
447447 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
448448 rmd160_init(&md);
449 rmd160_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg));
449 rmd160_process(&md, (unsigned char *)tests[i].msg, XSTRLEN(tests[i].msg));
450450 rmd160_done(&md, tmp);
451451 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD160", i)) {
452452 return CRYPT_FAIL_TESTVECTOR;
412412
413413 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
414414 rmd256_init(&md);
415 rmd256_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg));
415 rmd256_process(&md, (unsigned char *)tests[i].msg, XSTRLEN(tests[i].msg));
416416 rmd256_done(&md, tmp);
417417 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD256", i)) {
418418 return CRYPT_FAIL_TESTVECTOR;
477477
478478 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
479479 rmd320_init(&md);
480 rmd320_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg));
480 rmd320_process(&md, (unsigned char *)tests[i].msg, XSTRLEN(tests[i].msg));
481481 rmd320_done(&md, tmp);
482482 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD320", i)) {
483483 return CRYPT_FAIL_TESTVECTOR;
266266
267267 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
268268 sha1_init(&md);
269 sha1_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
269 sha1_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
270270 sha1_done(&md, tmp);
271271 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA1", i)) {
272272 return CRYPT_FAIL_TESTVECTOR;
110110
111111 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
112112 sha224_init(&md);
113 sha224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
113 sha224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
114114 sha224_done(&md, tmp);
115115 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA224", i)) {
116116 return CRYPT_FAIL_TESTVECTOR;
314314
315315 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
316316 sha256_init(&md);
317 sha256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
317 sha256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
318318 sha256_done(&md, tmp);
319319 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA256", i)) {
320320 return CRYPT_FAIL_TESTVECTOR;
116116
117117 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
118118 sha384_init(&md);
119 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
119 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
120120 sha384_done(&md, tmp);
121121 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA384", i)) {
122122 return CRYPT_FAIL_TESTVECTOR;
292292
293293 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
294294 sha512_init(&md);
295 sha512_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
295 sha512_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
296296 sha512_done(&md, tmp);
297297 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512", i)) {
298298 return CRYPT_FAIL_TESTVECTOR;
112112
113113 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
114114 sha512_224_init(&md);
115 sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
115 sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
116116 sha512_224_done(&md, tmp);
117117 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-224", i)) {
118118 return CRYPT_FAIL_TESTVECTOR;
112112
113113 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
114114 sha512_256_init(&md);
115 sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
115 sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
116116 sha512_256_done(&md, tmp);
117117 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-265", i)) {
118118 return CRYPT_FAIL_TESTVECTOR;
770770
771771 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
772772 tiger_init(&md);
773 tiger_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg));
773 tiger_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg));
774774 tiger_done(&md, tmp);
775775 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "TIGER", i)) {
776776 return CRYPT_FAIL_TESTVECTOR;
1818 #include <limits.h>
1919
2020 /* use configuration data */
21 #include <tomcrypt_custom.h>
21 #include "tomcrypt_custom.h"
2222
2323 #ifdef __cplusplus
2424 extern "C" {
8080 CRYPT_HASH_OVERFLOW /* Hash applied to too many bits */
8181 };
8282
83 #include <tomcrypt_cfg.h>
84 #include <tomcrypt_macros.h>
85 #include <tomcrypt_cipher.h>
86 #include <tomcrypt_hash.h>
87 #include <tomcrypt_mac.h>
88 #include <tomcrypt_prng.h>
89 #include <tomcrypt_pk.h>
90 #include <tomcrypt_math.h>
91 #include <tomcrypt_misc.h>
92 #include <tomcrypt_argchk.h>
93 #include <tomcrypt_pkcs.h>
83 #include "tomcrypt_cfg.h"
84 #include "tomcrypt_macros.h"
85 #include "tomcrypt_cipher.h"
86 #include "tomcrypt_hash.h"
87 #include "tomcrypt_mac.h"
88 #include "tomcrypt_prng.h"
89 #include "tomcrypt_pk.h"
90 #include "tomcrypt_math.h"
91 #include "tomcrypt_misc.h"
92 #include "tomcrypt_argchk.h"
93 #include "tomcrypt_pkcs.h"
9494
9595 #ifdef __cplusplus
9696 }
205205 #ifdef _MSC_VER
206206 #define CONST64(n) n ## ui64
207207 typedef unsigned __int64 ulong64;
208 typedef __int64 long64;
208209 #else
209210 #define CONST64(n) n ## ULL
210211 typedef unsigned long long ulong64;
212 typedef long long long64;
211213 #endif
212214
213215 /* ulong32: "32-bit at least" data type */
240242 #undef ENDIAN_32BITWORD
241243 #undef ENDIAN_64BITWORD
242244 #undef LTC_FAST
245 #define LTC_NO_BSWAP
243246 #define LTC_NO_ROLC
244 #define LTC_NO_BSWAP
247 #define LTC_NO_ROTATE
245248 #endif
246249
247250 /* No LTC_FAST if: explicitly disabled OR non-gcc/non-clang compiler OR old gcc OR using -ansi -std=c99 */
286289 #define LTC_HAVE_BSWAP_BUILTIN
287290 #endif
288291
289 #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
290 #define LTC_DEPRECATED __attribute__((deprecated))
292 #if !defined(LTC_NO_ROTATE) && (__has_builtin(__builtin_rotateleft32) && __has_builtin(__builtin_rotateright32))
293 #define LTC_HAVE_ROTATE_BUILTIN
294 #endif
295
296 #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
297 # define LTC_DEPRECATED(s) __attribute__((deprecated("replaced by " #s)))
298 # define PRIVATE_LTC_DEPRECATED_PRAGMA(s) _Pragma(#s)
299 # define LTC_DEPRECATED_PRAGMA(s) PRIVATE_LTC_DEPRECATED_PRAGMA(GCC warning s)
300 #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
301 # define LTC_DEPRECATED(s) __attribute__((deprecated))
302 # define LTC_DEPRECATED_PRAGMA(s)
291303 #elif defined(_MSC_VER) && _MSC_VER >= 1500
292304 /* supported since Visual Studio 2008 */
293 #define LTC_DEPRECATED __declspec(deprecated)
294 #else
295 #define LTC_DEPRECATED
296 #endif
297
305 # define LTC_DEPRECATED(s) __declspec(deprecated("replaced by " #s))
306 # define LTC_DEPRECATED_PRAGMA(s) __pragma(message(s))
307 #else
308 # define LTC_DEPRECATED(s)
309 # define LTC_DEPRECATED_PRAGMA(s)
310 #endif
298311 /* ref: $Format:%D$ */
299312 /* git commit: $Format:%H$ */
300313 /* commit time: $Format:%ai$ */
170170 };
171171 #endif
172172
173 #ifdef LTC_TEA
174 struct tea_key {
175 ulong32 k[4];
176 };
177 #endif
178
173179 typedef union Symmetric_key {
174180 #ifdef LTC_DES
175181 struct des_key des;
234240 #endif
235241 #ifdef LTC_SERPENT
236242 struct serpent_key serpent;
243 #endif
244 #ifdef LTC_TEA
245 struct tea_key tea;
237246 #endif
238247 void *data;
239248 } symmetric_key;
858867 extern const struct ltc_cipher_descriptor serpent_desc;
859868 #endif
860869
870 #ifdef LTC_TEA
871 int tea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
872 int tea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey);
873 int tea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey);
874 int tea_test(void);
875 void tea_done(symmetric_key *skey);
876 int tea_keysize(int *keysize);
877 extern const struct ltc_cipher_descriptor tea_desc;
878 #endif
879
861880 #ifdef LTC_ECB_MODE
862881 int ecb_start(int cipher, const unsigned char *key,
863882 int keylen, int num_rounds, symmetric_ECB *ecb);
4444 #ifndef XSTRCMP
4545 #define XSTRCMP strcmp
4646 #endif
47 #ifndef XSTRLEN
48 #define XSTRLEN strlen
49 #endif
4750 #ifndef XSTRNCPY
4851 #define XSTRNCPY strncpy
4952 #endif
5861
5962 #if ( defined(malloc) || defined(realloc) || defined(calloc) || defined(free) || \
6063 defined(memset) || defined(memcpy) || defined(memcmp) || defined(strcmp) || \
61 defined(strncpy) || defined(clock) || defined(qsort) ) && !defined(LTC_NO_PROTOTYPES)
64 defined(strlen) || defined(strncpy) || defined(clock) || defined(qsort) ) \
65 && !defined(LTC_NO_PROTOTYPES)
6266 #define LTC_NO_PROTOTYPES
6367 #endif
6468
206210 #define LTC_CAMELLIA
207211 #define LTC_IDEA
208212 #define LTC_SERPENT
213 #define LTC_TEA
209214
210215 /* stream ciphers */
211216 #define LTC_CHACHA
430435 /* Digital Signature Algorithm */
431436 #define LTC_MDSA
432437
438 /* Ed25519 & X25519 */
439 #define LTC_CURVE25519
440
433441 /* ECC */
434442 #define LTC_MECC
435443
484492 #define LTC_BASE32
485493 /* Base16/hex encoding/decoding */
486494 #define LTC_BASE16
495
496 #define LTC_BCRYPT
497
498 #ifndef LTC_BCRYPT_DEFAULT_ROUNDS
499 #define LTC_BCRYPT_DEFAULT_ROUNDS 10
500 #endif
487501
488502 /* Keep LTC_NO_HKDF for compatibility reasons
489503 * superseeded by LTC_NO_MISC*/
596610 #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled
597611 #endif
598612
613 #if defined(LTC_BCRYPT) && !defined(LTC_BLOWFISH)
614 #error LTC_BCRYPT requires LTC_BLOWFISH
615 #endif
616
599617 #if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA) || !defined(LTC_POLY1305))
600618 #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305
601619 #endif
240240
241241 /* 32-bit Rotates */
242242 #if defined(_MSC_VER)
243 #define LTC_ROx_ASM
243 #define LTC_ROx_BUILTIN
244244
245245 /* instrinsic rotate */
246246 #include <stdlib.h>
247 #pragma intrinsic(_lrotr,_lrotl)
248 #define ROR(x,n) _lrotr(x,n)
249 #define ROL(x,n) _lrotl(x,n)
250 #define RORc(x,n) _lrotr(x,n)
251 #define ROLc(x,n) _lrotl(x,n)
247 #pragma intrinsic(_rotr,_rotl)
248 #define ROR(x,n) _rotr(x,n)
249 #define ROL(x,n) _rotl(x,n)
250 #define RORc(x,n) ROR(x,n)
251 #define ROLc(x,n) ROL(x,n)
252
253 #elif defined(LTC_HAVE_ROTATE_BUILTIN)
254 #define LTC_ROx_BUILTIN
255
256 #define ROR(x,n) __builtin_rotateright32(x,n)
257 #define ROL(x,n) __builtin_rotateleft32(x,n)
258 #define ROLc(x,n) ROL(x,n)
259 #define RORc(x,n) ROR(x,n)
252260
253261 #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
254262 #define LTC_ROx_ASM
352360
353361
354362 /* 64-bit Rotates */
355 #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(_WIN64) && !defined(LTC_NO_ASM)
363 #if defined(_MSC_VER)
364
365 /* instrinsic rotate */
366 #include <stdlib.h>
367 #pragma intrinsic(_rotr64,_rotr64)
368 #define ROR64(x,n) _rotr64(x,n)
369 #define ROL64(x,n) _rotl64(x,n)
370 #define ROR64c(x,n) ROR64(x,n)
371 #define ROL64c(x,n) ROL64(x,n)
372
373 #elif defined(LTC_HAVE_ROTATE_BUILTIN)
374
375 #define ROR64(x,n) __builtin_rotateright64(x,n)
376 #define ROL64(x,n) __builtin_rotateleft64(x,n)
377 #define ROR64c(x,n) ROR64(x,n)
378 #define ROL64c(x,n) ROL64(x,n)
379
380 #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
356381
357382 static inline ulong64 ROL64(ulong64 word, int i)
358383 {