rbnacl-libsodium 1.0.11 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/vendor/libsodium/AUTHORS +45 -33
- data/vendor/libsodium/ChangeLog +63 -2
- data/vendor/libsodium/LICENSE +1 -1
- data/vendor/libsodium/Makefile.am +1 -0
- data/vendor/libsodium/Makefile.in +17 -14
- data/vendor/libsodium/README.markdown +1 -0
- data/vendor/libsodium/THANKS +38 -4
- data/vendor/libsodium/aclocal.m4 +25 -24
- data/vendor/libsodium/autogen.sh +12 -7
- data/vendor/libsodium/autom4te.cache/output.0 +5066 -2281
- data/vendor/libsodium/autom4te.cache/output.1 +1013 -600
- data/vendor/libsodium/autom4te.cache/output.2 +5066 -2281
- data/vendor/libsodium/autom4te.cache/requests +426 -1584
- data/vendor/libsodium/autom4te.cache/traces.0 +2044 -876
- data/vendor/libsodium/autom4te.cache/traces.1 +996 -523
- data/vendor/libsodium/autom4te.cache/traces.2 +1996 -828
- data/vendor/libsodium/build-aux/compile +5 -4
- data/vendor/libsodium/build-aux/config.guess +120 -68
- data/vendor/libsodium/build-aux/config.sub +51 -22
- data/vendor/libsodium/build-aux/depcomp +3 -3
- data/vendor/libsodium/build-aux/install-sh +2 -2
- data/vendor/libsodium/build-aux/missing +3 -3
- data/vendor/libsodium/build-aux/test-driver +3 -3
- data/vendor/libsodium/builds/msvc/properties/Win32.props +4 -1
- data/vendor/libsodium/builds/msvc/properties/x64.props +4 -1
- data/vendor/libsodium/builds/msvc/resource.h +14 -0
- data/vendor/libsodium/builds/msvc/resource.rc +63 -0
- data/vendor/libsodium/builds/msvc/version.h +7 -4
- data/vendor/libsodium/builds/msvc/vs2010/libsodium.import.props +1 -1
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.props +10 -5
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +182 -139
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +632 -470
- data/vendor/libsodium/builds/msvc/vs2012/libsodium.import.props +1 -1
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.props +10 -5
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +182 -129
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +632 -470
- data/vendor/libsodium/builds/msvc/vs2013/libsodium.import.props +1 -1
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.props +10 -5
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +182 -129
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +632 -470
- data/vendor/libsodium/builds/msvc/vs2015/libsodium.import.props +1 -1
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.props +10 -5
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +181 -118
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +632 -470
- data/vendor/libsodium/builds/msvc/vs2017/libsodium.import.props +52 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium.import.xml +17 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium.sln +52 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.props +48 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +320 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +962 -0
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.xml +15 -0
- data/vendor/libsodium/configure +1002 -589
- data/vendor/libsodium/configure.ac +48 -21
- data/vendor/libsodium/contrib/Findsodium.cmake +267 -0
- data/vendor/libsodium/contrib/Makefile.am +3 -0
- data/vendor/libsodium/contrib/Makefile.in +483 -0
- data/vendor/libsodium/dist-build/Makefile.in +11 -7
- data/vendor/libsodium/dist-build/android-armv8-a.sh +1 -1
- data/vendor/libsodium/dist-build/android-build.sh +25 -17
- data/vendor/libsodium/dist-build/android-mips32.sh +1 -1
- data/vendor/libsodium/dist-build/android-mips64.sh +1 -1
- data/vendor/libsodium/dist-build/android-x86_64.sh +1 -1
- data/vendor/libsodium/dist-build/emscripten-symbols.def +150 -2
- data/vendor/libsodium/dist-build/emscripten-wasm.sh +132 -0
- data/vendor/libsodium/dist-build/emscripten.sh +8 -6
- data/vendor/libsodium/dist-build/ios.sh +29 -5
- data/vendor/libsodium/libsodium.vcxproj +139 -77
- data/vendor/libsodium/libsodium.vcxproj.filters +315 -144
- data/vendor/libsodium/m4/ax_check_catchable_segv.m4 +42 -0
- data/vendor/libsodium/m4/ax_check_compile_flag.m4 +6 -4
- data/vendor/libsodium/m4/ax_check_define.m4 +3 -3
- data/vendor/libsodium/m4/ax_check_gnu_make.m4 +31 -25
- data/vendor/libsodium/m4/ax_check_link_flag.m4 +8 -6
- data/vendor/libsodium/m4/ax_pthread.m4 +275 -275
- data/vendor/libsodium/m4/ax_valgrind_check.m4 +92 -41
- data/vendor/libsodium/m4/pkg.m4 +1 -1
- data/vendor/libsodium/msvc-scripts/Makefile.in +11 -7
- data/vendor/libsodium/msvc-scripts/process.bat +4 -3
- data/vendor/libsodium/packaging/dotnet-core/README.md +59 -0
- data/vendor/libsodium/packaging/dotnet-core/desktop.targets +16 -0
- data/vendor/libsodium/packaging/dotnet-core/libsodium.props +33 -0
- data/vendor/libsodium/packaging/dotnet-core/prepare.py +262 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/alpine-x64 +3 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/build +9 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/centos-x64 +3 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/debian-x64 +4 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/fedora-x64 +3 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/opensuse-x64 +3 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/pack +5 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/test +27 -0
- data/vendor/libsodium/packaging/dotnet-core/recipes/ubuntu-x64 +4 -0
- data/vendor/libsodium/packaging/nuget/package.config +1 -1
- data/vendor/libsodium/packaging/nuget/package.gsl +3 -3
- data/vendor/libsodium/src/Makefile.in +11 -7
- data/vendor/libsodium/src/libsodium/Makefile.am +113 -98
- data/vendor/libsodium/src/libsodium/Makefile.in +1034 -1236
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +31 -12
- data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +31 -10
- data/vendor/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c +153 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/crypto_auth.c +7 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/{cp/hmac_hmacsha256.c → auth_hmacsha256.c} +43 -35
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/{cp/hmac_hmacsha512.c → auth_hmacsha512.c} +43 -35
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/{cp/hmac_hmacsha512256.c → auth_hmacsha512256.c} +48 -9
- data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +4 -3
- data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_seal.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +197 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c +79 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c +150 -0
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +1156 -662
- data/vendor/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c +12 -5
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/{core_hsalsa20_api.c → core_hsalsa20.c} +0 -0
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c +95 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c +195 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/{blake2/generichash_blake2_api.c → blake2b/generichash_blake2.c} +7 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h +109 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c +49 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h +140 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c +92 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c +87 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h +103 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c +90 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h +103 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h +340 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse2.h +164 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse41.h +307 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +494 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/{blake2 → blake2b}/ref/generichash_blake2b.c +22 -26
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +7 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +254 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/{hash_sha256_api.c → hash_sha256.c} +4 -2
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +280 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/{hash_sha512_api.c → hash_sha512.c} +4 -2
- data/vendor/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c +52 -0
- data/vendor/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c +49 -0
- data/vendor/libsodium/src/libsodium/crypto_kx/crypto_kx.c +136 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c +6 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c +34 -27
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +203 -156
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +178 -134
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +22 -4
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h +10 -12
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +564 -315
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +131 -84
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +23 -18
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +163 -145
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h +2 -1
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +247 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +42 -29
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +71 -47
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +100 -65
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +77 -23
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c +30 -31
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx2.h +150 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h +28 -26
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h +102 -99
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +90 -41
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +213 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c +72 -4
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +34 -37
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +27 -32
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +120 -86
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +16 -13
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h +4 -4
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +98 -50
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +23 -18
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +105 -105
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +395 -330
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +225 -198
- data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +7 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +6 -5
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +170 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c +83 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c +7 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c +65 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash_ref.h +24 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c +71 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/{shorthash_siphash24_api.c → shorthash_siphash24.c} +0 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +33 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ed25519_ref10.h +18 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +18 -13
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +29 -26
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +75 -36
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +39 -15
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +91 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c +174 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c +66 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/common.h +766 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts.h +28 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c +28 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128.h +50 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c +149 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c +31 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c +195 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/{stream_aes128ctr_api.c → stream_aes128ctr.c} +6 -3
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +179 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +173 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h +86 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u1.h +98 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u4.h +175 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h +357 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/{stream_chacha20_ref.c → chacha20_ref.c} +93 -94
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +39 -7
- data/vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c +7 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c +120 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +93 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.h +16 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/{amd64_xmm6/stream_salsa20_amd64_xmm6.S → xmm6/salsa20_xmm6-asm.S} +20 -12
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c +31 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c +131 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c +122 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h +195 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h +207 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h +547 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h +476 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c +106 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c +20 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c +106 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c +20 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c +63 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c +60 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/sodium/verify.c +61 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.am +8 -6
- data/vendor/libsodium/src/libsodium/include/Makefile.in +29 -21
- data/vendor/libsodium/src/libsodium/include/sodium.h +15 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +6 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +91 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +5 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +153 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +3 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +4 -3
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h +4 -3
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_kdf.h +51 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h +42 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_kx.h +64 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +11 -9
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +37 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +40 -10
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +116 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +37 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +0 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +62 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +5 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +18 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +22 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +28 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +10 -5
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +14 -3
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xchacha20.h +53 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/common.h +84 -17
- data/vendor/libsodium/src/libsodium/include/sodium/private/implementations.h +11 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h +50 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +10 -2
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +4 -5
- data/vendor/libsodium/src/libsodium/include/sodium/version.h.in +4 -0
- data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +47 -19
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +30 -50
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +25 -15
- data/vendor/libsodium/src/libsodium/sodium/core.c +25 -23
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +66 -57
- data/vendor/libsodium/src/libsodium/sodium/utils.c +120 -106
- data/vendor/libsodium/src/libsodium/sodium/version.c +10 -0
- data/vendor/libsodium/test/Makefile.in +11 -7
- data/vendor/libsodium/test/default/Makefile.am +65 -5
- data/vendor/libsodium/test/default/Makefile.in +243 -78
- data/vendor/libsodium/test/default/aead_aes256gcm.c +2 -2
- data/vendor/libsodium/test/default/aead_xchacha20poly1305.c +188 -0
- data/vendor/libsodium/test/default/aead_xchacha20poly1305.exp +51 -0
- data/vendor/libsodium/test/default/auth.c +11 -7
- data/vendor/libsodium/test/default/auth2.c +15 -12
- data/vendor/libsodium/test/default/auth3.c +18 -15
- data/vendor/libsodium/test/default/auth5.c +3 -2
- data/vendor/libsodium/test/default/auth6.c +4 -3
- data/vendor/libsodium/test/default/auth7.c +3 -2
- data/vendor/libsodium/test/default/box.c +57 -52
- data/vendor/libsodium/test/default/box2.c +41 -36
- data/vendor/libsodium/test/default/box7.c +4 -3
- data/vendor/libsodium/test/default/box8.c +4 -3
- data/vendor/libsodium/test/default/box_easy.c +36 -32
- data/vendor/libsodium/test/default/box_easy2.c +41 -34
- data/vendor/libsodium/test/default/box_seal.c +7 -6
- data/vendor/libsodium/test/default/box_seed.c +10 -8
- data/vendor/libsodium/test/default/chacha20.c +18 -3
- data/vendor/libsodium/test/default/chacha20.exp +45 -0
- data/vendor/libsodium/test/default/cmptest.h +1 -0
- data/vendor/libsodium/test/default/core1.c +10 -9
- data/vendor/libsodium/test/default/core2.c +13 -12
- data/vendor/libsodium/test/default/core3.c +13 -12
- data/vendor/libsodium/test/default/core4.c +11 -12
- data/vendor/libsodium/test/default/core5.c +13 -12
- data/vendor/libsodium/test/default/core6.c +15 -13
- data/vendor/libsodium/test/default/ed25519_convert.c +12 -9
- data/vendor/libsodium/test/default/hash.c +10 -6
- data/vendor/libsodium/test/default/hash3.c +3 -2
- data/vendor/libsodium/test/default/index-wasm.html.tpl +118 -0
- data/vendor/libsodium/test/default/kdf.c +61 -0
- data/vendor/libsodium/test/default/kdf.exp +77 -0
- data/vendor/libsodium/test/default/keygen.c +64 -0
- data/vendor/libsodium/test/default/keygen.exp +1 -0
- data/vendor/libsodium/test/default/kx.c +119 -0
- data/vendor/libsodium/test/default/kx.exp +7 -0
- data/vendor/libsodium/test/default/nacl-test-wrapper.sh +9 -2
- data/vendor/libsodium/test/default/onetimeauth.c +26 -23
- data/vendor/libsodium/test/default/onetimeauth2.c +22 -20
- data/vendor/libsodium/test/default/onetimeauth7.c +3 -2
- data/vendor/libsodium/test/default/pwhash.c +209 -157
- data/vendor/libsodium/test/default/pwhash_argon2id.c +388 -0
- data/vendor/libsodium/test/default/pwhash_argon2id.exp +15 -0
- data/vendor/libsodium/test/default/pwhash_scrypt.c +232 -224
- data/vendor/libsodium/test/default/pwhash_scrypt.exp +2 -1
- data/vendor/libsodium/test/default/pwhash_scrypt_ll.c +39 -41
- data/vendor/libsodium/test/default/randombytes.c +34 -13
- data/vendor/libsodium/test/default/randombytes.exp +1 -0
- data/vendor/libsodium/test/default/scalarmult.c +21 -18
- data/vendor/libsodium/test/default/scalarmult2.c +8 -6
- data/vendor/libsodium/test/default/scalarmult5.c +13 -10
- data/vendor/libsodium/test/default/scalarmult6.c +17 -14
- data/vendor/libsodium/test/default/scalarmult7.c +9 -10
- data/vendor/libsodium/test/default/secretbox.c +39 -36
- data/vendor/libsodium/test/default/secretbox2.c +28 -25
- data/vendor/libsodium/test/default/secretbox7.c +3 -2
- data/vendor/libsodium/test/default/secretbox8.c +4 -3
- data/vendor/libsodium/test/default/secretbox_easy.c +40 -37
- data/vendor/libsodium/test/default/secretbox_easy2.c +19 -18
- data/vendor/libsodium/test/default/shorthash.c +4 -4
- data/vendor/libsodium/test/default/sign.c +70 -13
- data/vendor/libsodium/test/default/sign.exp +2 -0
- data/vendor/libsodium/test/default/siphashx24.c +33 -0
- data/vendor/libsodium/test/default/siphashx24.exp +64 -0
- data/vendor/libsodium/test/default/sodium_core.c +9 -8
- data/vendor/libsodium/test/default/sodium_utils.c +52 -46
- data/vendor/libsodium/test/default/sodium_utils2.c +17 -8
- data/vendor/libsodium/test/default/sodium_utils3.c +15 -6
- data/vendor/libsodium/test/default/sodium_version.c +7 -1
- data/vendor/libsodium/test/default/stream.c +31 -18
- data/vendor/libsodium/test/default/stream.exp +65 -0
- data/vendor/libsodium/test/default/stream2.c +13 -9
- data/vendor/libsodium/test/default/stream3.c +12 -10
- data/vendor/libsodium/test/default/stream4.c +30 -27
- data/vendor/libsodium/test/default/verify1.c +5 -4
- data/vendor/libsodium/test/default/xchacha20.c +376 -0
- data/vendor/libsodium/test/default/xchacha20.exp +5 -0
- data/vendor/libsodium/test/quirks/quirks.h +4 -3
- metadata +140 -111
- data/vendor/libsodium/autom4te.cache/output.3 +0 -17240
- data/vendor/libsodium/autom4te.cache/output.4 +0 -17517
- data/vendor/libsodium/autom4te.cache/output.5 +0 -18535
- data/vendor/libsodium/autom4te.cache/output.6 +0 -19077
- data/vendor/libsodium/autom4te.cache/output.7 +0 -19837
- data/vendor/libsodium/autom4te.cache/traces.3 +0 -2833
- data/vendor/libsodium/autom4te.cache/traces.4 +0 -2951
- data/vendor/libsodium/autom4te.cache/traces.5 +0 -3042
- data/vendor/libsodium/autom4te.cache/traces.6 +0 -3194
- data/vendor/libsodium/autom4te.cache/traces.7 +0 -3614
- data/vendor/libsodium/builds/msvc/properties/ARM.props +0 -20
- data/vendor/libsodium/compile +0 -347
- data/vendor/libsodium/config.guess +0 -1568
- data/vendor/libsodium/config.sub +0 -1793
- data/vendor/libsodium/depcomp +0 -791
- data/vendor/libsodium/install-sh +0 -527
- data/vendor/libsodium/ltmain.sh +0 -9655
- data/vendor/libsodium/missing +0 -215
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c +0 -12
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305_api.c +0 -41
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c +0 -22
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +0 -18
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c +0 -42
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +0 -29
- data/vendor/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.h +0 -28
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +0 -100
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/core_salsa20_api.c +0 -21
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +0 -126
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/core_salsa2012_api.c +0 -21
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +0 -126
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/core_salsa208_api.c +0 -21
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +0 -126
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2-impl.h +0 -48
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-avx2.c +0 -45
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-avx2.h +0 -123
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ref.c +0 -94
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-sse41.c +0 -80
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-sse41.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ssse3.c +0 -87
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ssse3.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-avx2.h +0 -339
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-sse2.h +0 -66
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-sse41.h +0 -400
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +0 -456
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +0 -269
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +0 -298
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-impl.h +0 -40
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c +0 -35
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c +0 -26
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +0 -72
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/description +0 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519_api.c +0 -39
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +0 -159
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +0 -59
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common.h +0 -771
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts.h +0 -28
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts_aes128ctr.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128.h +0 -56
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128_aes128ctr.c +0 -131
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +0 -29
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/types.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +0 -180
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.h +0 -28
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.c +0 -336
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.h +0 -28
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +0 -55
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +0 -63
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c +0 -19
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +0 -51
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +0 -54
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012_api.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +0 -51
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +0 -54
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208_api.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +0 -24
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +0 -35
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20_api.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c +0 -17
- data/vendor/libsodium/src/libsodium/crypto_verify/16/verify_16_api.c +0 -6
- data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c +0 -17
- data/vendor/libsodium/src/libsodium/crypto_verify/32/verify_32_api.c +0 -6
- data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/verify_64.c +0 -17
- data/vendor/libsodium/src/libsodium/crypto_verify/64/verify_64_api.c +0 -6
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_int32.h +0 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_int64.h +0 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint16.h +0 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint32.h +0 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint64.h +0 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint8.h +0 -8
- data/vendor/libsodium/test-driver +0 -139
@@ -1,2 +1,67 @@
|
|
1
1
|
662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2
|
2
2
|
0cc9ffaf60a99d221b548e9762385a231121ab226d1c610d2661ced26b6ad5ee
|
3
|
+
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
4
|
+
ee010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
|
5
|
+
eea60202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
|
6
|
+
eea6a703030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303
|
7
|
+
eea6a725040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404
|
8
|
+
eea6a7251c0505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505
|
9
|
+
eea6a7251c1e06060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606
|
10
|
+
eea6a7251c1e72070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707
|
11
|
+
eea6a7251c1e72910808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808
|
12
|
+
eea6a7251c1e72916d09090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909
|
13
|
+
eea6a7251c1e72916d110a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a
|
14
|
+
eea6a7251c1e72916d11c20b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
|
15
|
+
eea6a7251c1e72916d11c2cb0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
|
16
|
+
eea6a7251c1e72916d11c2cb210d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d
|
17
|
+
eea6a7251c1e72916d11c2cb214d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e
|
18
|
+
eea6a7251c1e72916d11c2cb214d3c0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
|
19
|
+
eea6a7251c1e72916d11c2cb214d3c25101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
|
20
|
+
eea6a7251c1e72916d11c2cb214d3c25251111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
21
|
+
eea6a7251c1e72916d11c2cb214d3c25253912121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212
|
22
|
+
eea6a7251c1e72916d11c2cb214d3c25253912131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313
|
23
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d1414141414141414141414141414141414141414141414141414141414141414141414141414141414141414
|
24
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e15151515151515151515151515151515151515151515151515151515151515151515151515151515151515
|
25
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e23161616161616161616161616161616161616161616161616161616161616161616161616161616161616
|
26
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e1717171717171717171717171717171717171717171717171717171717171717171717171717171717
|
27
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e6518181818181818181818181818181818181818181818181818181818181818181818181818181818
|
28
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d191919191919191919191919191919191919191919191919191919191919191919191919191919
|
29
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
|
30
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651f1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
|
31
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa41c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c
|
32
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c81d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d
|
33
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cf1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e
|
34
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff81f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f
|
35
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff8802020202020202020202020202020202020202020202020202020202020202020
|
36
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff8803021212121212121212121212121212121212121212121212121212121212121
|
37
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e222222222222222222222222222222222222222222222222222222222222
|
38
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e642323232323232323232323232323232323232323232323232323232323
|
39
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a24242424242424242424242424242424242424242424242424242424
|
40
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74252525252525252525252525252525252525252525252525252525
|
41
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e92626262626262626262626262626262626262626262626262626
|
42
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e027272727272727272727272727272727272727272727272727
|
43
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a6282828282828282828282828282828282828282828282828
|
44
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d2929292929292929292929292929292929292929292929
|
45
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d822a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
|
46
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d82432b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
|
47
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243ac2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c
|
48
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd92d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d
|
49
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9172e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e
|
50
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177a2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
|
51
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab530303030303030303030303030303030
|
52
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a313131313131313131313131313131
|
53
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1b3232323232323232323232323232
|
54
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb33333333333333333333333333
|
55
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d343434343434343434343434
|
56
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a3535353535353535353535
|
57
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f36363636363636363636
|
58
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d373737373737373737
|
59
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d703838383838383838
|
60
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c39393939393939
|
61
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093a3a3a3a3a3a
|
62
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c3b3b3b3b3b
|
63
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e3c3c3c3c
|
64
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e553d3d3d
|
65
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e55853e3e
|
66
|
+
eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e5585573f
|
67
|
+
b46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44
|
@@ -2,19 +2,21 @@
|
|
2
2
|
#define TEST_NAME "stream2"
|
3
3
|
#include "cmptest.h"
|
4
4
|
|
5
|
-
static unsigned char secondkey[32]
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
static unsigned char secondkey[32] = { 0xdc, 0x90, 0x8d, 0xda, 0x0b, 0x93, 0x44,
|
6
|
+
0xa9, 0x53, 0x62, 0x9b, 0x73, 0x38, 0x20,
|
7
|
+
0x77, 0x88, 0x80, 0xf3, 0xce, 0xb4, 0x21,
|
8
|
+
0xbb, 0x61, 0xb9, 0x1c, 0xbd, 0x4c, 0x3e,
|
9
|
+
0x66, 0x25, 0x6c, 0xe4 };
|
9
10
|
|
10
|
-
static unsigned char noncesuffix[8]
|
11
|
-
|
11
|
+
static unsigned char noncesuffix[8] = { 0x82, 0x19, 0xe0, 0x03,
|
12
|
+
0x6b, 0x7a, 0x0b, 0x37 };
|
12
13
|
|
13
14
|
static unsigned char output[4194304];
|
14
15
|
|
15
16
|
static unsigned char h[32];
|
16
17
|
|
17
|
-
int
|
18
|
+
int
|
19
|
+
main(void)
|
18
20
|
{
|
19
21
|
int i;
|
20
22
|
crypto_stream_salsa20(output, sizeof output, noncesuffix, secondkey);
|
@@ -25,11 +27,13 @@ int main(void)
|
|
25
27
|
|
26
28
|
assert(sizeof output > 4000);
|
27
29
|
|
28
|
-
crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 0U,
|
30
|
+
crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 0U,
|
31
|
+
secondkey);
|
29
32
|
for (i = 0; i < 4000; ++i)
|
30
33
|
assert(output[i] == 0);
|
31
34
|
|
32
|
-
crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 1U,
|
35
|
+
crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 1U,
|
36
|
+
secondkey);
|
33
37
|
crypto_hash_sha256(h, output, sizeof output);
|
34
38
|
for (i = 0; i < 32; ++i)
|
35
39
|
printf("%02x", h[i]);
|
@@ -2,26 +2,28 @@
|
|
2
2
|
#define TEST_NAME "stream3"
|
3
3
|
#include "cmptest.h"
|
4
4
|
|
5
|
-
static unsigned char firstkey[32]
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85,
|
6
|
+
0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a,
|
7
|
+
0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac,
|
8
|
+
0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08,
|
9
|
+
0x44, 0xf6, 0x83, 0x89 };
|
9
10
|
|
10
|
-
static unsigned char nonce[24]
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6,
|
12
|
+
0x2b, 0x73, 0xcd, 0x62, 0xbd, 0xa8,
|
13
|
+
0x75, 0xfc, 0x73, 0xd6, 0x82, 0x19,
|
14
|
+
0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 };
|
14
15
|
|
15
16
|
static unsigned char rs[32];
|
16
17
|
|
17
|
-
int
|
18
|
+
int
|
19
|
+
main(void)
|
18
20
|
{
|
19
21
|
int i;
|
20
22
|
|
21
23
|
crypto_stream(rs, 32, nonce, firstkey);
|
22
24
|
|
23
25
|
for (i = 0; i < 32; ++i) {
|
24
|
-
printf(",0x%02x", (unsigned int)rs[i]);
|
26
|
+
printf(",0x%02x", (unsigned int) rs[i]);
|
25
27
|
if (i % 8 == 7)
|
26
28
|
printf("\n");
|
27
29
|
}
|
@@ -2,42 +2,45 @@
|
|
2
2
|
#define TEST_NAME "stream4"
|
3
3
|
#include "cmptest.h"
|
4
4
|
|
5
|
-
static unsigned char firstkey[32]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
5
|
+
static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85,
|
6
|
+
0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a,
|
7
|
+
0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac,
|
8
|
+
0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08,
|
9
|
+
0x44, 0xf6, 0x83, 0x89 };
|
10
|
+
|
11
|
+
static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6,
|
12
|
+
0x2b, 0x73, 0xcd, 0x62, 0xbd, 0xa8,
|
13
|
+
0x75, 0xfc, 0x73, 0xd6, 0x82, 0x19,
|
14
|
+
0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 };
|
15
|
+
|
16
|
+
static unsigned char m[163] = {
|
17
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
18
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
19
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0xbe, 0x07, 0x5f, 0xc5,
|
20
|
+
0x3c, 0x81, 0xf2, 0xd5, 0xcf, 0x14, 0x13, 0x16, 0xeb, 0xeb, 0x0c, 0x7b,
|
21
|
+
0x52, 0x28, 0xc5, 0x2a, 0x4c, 0x62, 0xcb, 0xd4, 0x4b, 0x66, 0x84, 0x9b,
|
22
|
+
0x64, 0x24, 0x4f, 0xfc, 0xe5, 0xec, 0xba, 0xaf, 0x33, 0xbd, 0x75, 0x1a,
|
23
|
+
0x1a, 0xc7, 0x28, 0xd4, 0x5e, 0x6c, 0x61, 0x29, 0x6c, 0xdc, 0x3c, 0x01,
|
24
|
+
0x23, 0x35, 0x61, 0xf4, 0x1d, 0xb6, 0x6c, 0xce, 0x31, 0x4a, 0xdb, 0x31,
|
25
|
+
0x0e, 0x3b, 0xe8, 0x25, 0x0c, 0x46, 0xf0, 0x6d, 0xce, 0xea, 0x3a, 0x7f,
|
26
|
+
0xa1, 0x34, 0x80, 0x57, 0xe2, 0xf6, 0x55, 0x6a, 0xd6, 0xb1, 0x31, 0x8a,
|
27
|
+
0x02, 0x4a, 0x83, 0x8f, 0x21, 0xaf, 0x1f, 0xde, 0x04, 0x89, 0x77, 0xeb,
|
28
|
+
0x48, 0xf5, 0x9f, 0xfd, 0x49, 0x24, 0xca, 0x1c, 0x60, 0x90, 0x2e, 0x52,
|
29
|
+
0xf0, 0xa0, 0x89, 0xbc, 0x76, 0x89, 0x70, 0x40, 0xe0, 0x82, 0xf9, 0x37,
|
30
|
+
0x76, 0x38, 0x48, 0x64, 0x5e, 0x07, 0x05
|
31
|
+
};
|
30
32
|
|
31
33
|
static unsigned char c[163];
|
32
34
|
|
33
|
-
int
|
35
|
+
int
|
36
|
+
main(void)
|
34
37
|
{
|
35
38
|
int i;
|
36
39
|
|
37
40
|
crypto_stream_xor(c, m, 163, nonce, firstkey);
|
38
41
|
|
39
42
|
for (i = 32; i < 163; ++i) {
|
40
|
-
printf(",0x%02x", (unsigned int)c[i]);
|
43
|
+
printf(",0x%02x", (unsigned int) c[i]);
|
41
44
|
if (i % 8 == 7)
|
42
45
|
printf("\n");
|
43
46
|
}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
#define TEST_NAME "verify1"
|
3
3
|
#include "cmptest.h"
|
4
4
|
|
5
|
-
int
|
5
|
+
int
|
6
|
+
main(void)
|
6
7
|
{
|
7
8
|
unsigned char *v16, *v16x;
|
8
9
|
unsigned char *v32, *v32x;
|
@@ -11,11 +12,11 @@ int main(void)
|
|
11
12
|
uint8_t o;
|
12
13
|
int i;
|
13
14
|
|
14
|
-
v16
|
15
|
+
v16 = (unsigned char *) sodium_malloc(16);
|
15
16
|
v16x = (unsigned char *) sodium_malloc(16);
|
16
|
-
v32
|
17
|
+
v32 = (unsigned char *) sodium_malloc(32);
|
17
18
|
v32x = (unsigned char *) sodium_malloc(32);
|
18
|
-
v64
|
19
|
+
v64 = (unsigned char *) sodium_malloc(64);
|
19
20
|
v64x = (unsigned char *) sodium_malloc(64);
|
20
21
|
for (i = 0; i < 10000; i++) {
|
21
22
|
randombytes_buf(v16, 16);
|
@@ -0,0 +1,376 @@
|
|
1
|
+
|
2
|
+
#define TEST_NAME "xchacha20"
|
3
|
+
#include "cmptest.h"
|
4
|
+
|
5
|
+
typedef struct HChaCha20TV_ {
|
6
|
+
const char key[crypto_core_hchacha20_KEYBYTES * 2 + 1];
|
7
|
+
const char in[crypto_core_hchacha20_INPUTBYTES * 2 + 1];
|
8
|
+
const char out[crypto_core_hchacha20_OUTPUTBYTES * 2 + 1];
|
9
|
+
} HChaCha20TV;
|
10
|
+
|
11
|
+
static void
|
12
|
+
tv_hchacha20(void)
|
13
|
+
{
|
14
|
+
static const HChaCha20TV tvs[] = {
|
15
|
+
{ "24f11cce8a1b3d61e441561a696c1c1b7e173d084fd4812425435a8896a013dc", "d9660c5900ae19ddad28d6e06e45fe5e", "5966b3eec3bff1189f831f06afe4d4e3be97fa9235ec8c20d08acfbbb4e851e3" },
|
16
|
+
{ "80a5f6272031e18bb9bcd84f3385da65e7731b7039f13f5e3d475364cd4d42f7", "c0eccc384b44c88e92c57eb2d5ca4dfa", "6ed11741f724009a640a44fce7320954c46e18e0d7ae063bdbc8d7cf372709df" },
|
17
|
+
{ "cb1fc686c0eec11a89438b6f4013bf110e7171dace3297f3a657a309b3199629", "fcd49b93e5f8f299227e64d40dc864a3", "84b7e96937a1a0a406bb7162eeaad34308d49de60fd2f7ec9dc6a79cbab2ca34" },
|
18
|
+
{ "6640f4d80af5496ca1bc2cfff1fefbe99638dbceaabd7d0ade118999d45f053d", "31f59ceeeafdbfe8cae7914caeba90d6", "9af4697d2f5574a44834a2c2ae1a0505af9f5d869dbe381a994a18eb374c36a0" },
|
19
|
+
{ "0693ff36d971225a44ac92c092c60b399e672e4cc5aafd5e31426f123787ac27", "3a6293da061da405db45be1731d5fc4d", "f87b38609142c01095bfc425573bb3c698f9ae866b7e4216840b9c4caf3b0865" },
|
20
|
+
{ "809539bd2639a23bf83578700f055f313561c7785a4a19fc9114086915eee551", "780c65d6a3318e479c02141d3f0b3918", "902ea8ce4680c09395ce71874d242f84274243a156938aaa2dd37ac5be382b42" },
|
21
|
+
{ "1a170ddf25a4fd69b648926e6d794e73408805835c64b2c70efddd8cd1c56ce0", "05dbee10de87eb0c5acb2b66ebbe67d3", "a4e20b634c77d7db908d387b48ec2b370059db916e8ea7716dc07238532d5981" },
|
22
|
+
{ "3b354e4bb69b5b4a1126f509e84cad49f18c9f5f29f0be0c821316a6986e15a6", "d8a89af02f4b8b2901d8321796388b6c", "9816cb1a5b61993735a4b161b51ed2265b696e7ded5309c229a5a99f53534fbc" },
|
23
|
+
{ "4b9a818892e15a530db50dd2832e95ee192e5ed6afffb408bd624a0c4e12a081", "a9079c551de70501be0286d1bc78b045", "ebc5224cf41ea97473683b6c2f38a084bf6e1feaaeff62676db59d5b719d999b" },
|
24
|
+
{ "c49758f00003714c38f1d4972bde57ee8271f543b91e07ebce56b554eb7fa6a7", "31f0204e10cf4f2035f9e62bb5ba7303", "0dd8cc400f702d2c06ed920be52048a287076b86480ae273c6d568a2e9e7518c" }
|
25
|
+
};
|
26
|
+
const HChaCha20TV *tv;
|
27
|
+
unsigned char *constant;
|
28
|
+
unsigned char *key;
|
29
|
+
unsigned char *in;
|
30
|
+
unsigned char *out;
|
31
|
+
unsigned char *out2;
|
32
|
+
int i;
|
33
|
+
|
34
|
+
constant = (unsigned char *) sodium_malloc(crypto_core_hchacha20_CONSTBYTES);
|
35
|
+
key = (unsigned char *) sodium_malloc(crypto_core_hchacha20_KEYBYTES);
|
36
|
+
in = (unsigned char *) sodium_malloc(crypto_core_hchacha20_INPUTBYTES);
|
37
|
+
out = (unsigned char *) sodium_malloc(crypto_core_hchacha20_OUTPUTBYTES);
|
38
|
+
out2 = (unsigned char *) sodium_malloc(crypto_core_hchacha20_OUTPUTBYTES);
|
39
|
+
for (i = 0; i < (sizeof tvs) / (sizeof tvs[0]); i++) {
|
40
|
+
tv = &tvs[i];
|
41
|
+
sodium_hex2bin(key, crypto_core_hchacha20_KEYBYTES,
|
42
|
+
tv->key, strlen(tv->key), NULL, NULL, NULL);
|
43
|
+
sodium_hex2bin(in, crypto_core_hchacha20_INPUTBYTES,
|
44
|
+
tv->in, strlen(tv->in), NULL, NULL, NULL);
|
45
|
+
sodium_hex2bin(out, crypto_core_hchacha20_OUTPUTBYTES,
|
46
|
+
tv->out, strlen(tv->out), NULL, NULL, NULL);
|
47
|
+
crypto_core_hchacha20(out2, in, key, NULL);
|
48
|
+
assert(memcmp(out, out2, crypto_core_hchacha20_OUTPUTBYTES) == 0);
|
49
|
+
}
|
50
|
+
|
51
|
+
sodium_hex2bin(constant, crypto_core_hchacha20_CONSTBYTES,
|
52
|
+
"0d29b795c1ca70c1652e823364d32417",
|
53
|
+
crypto_core_hchacha20_CONSTBYTES * 2 + 1, NULL, NULL, NULL);
|
54
|
+
sodium_hex2bin(out, crypto_core_hchacha20_OUTPUTBYTES,
|
55
|
+
"934d941d78eb9bfc2f0376f7ccd4a11ecf0c6a44104618a9749ef47fe97037a2",
|
56
|
+
crypto_core_hchacha20_OUTPUTBYTES * 2 + 1, NULL, NULL, NULL);
|
57
|
+
|
58
|
+
crypto_core_hchacha20(out2, in, key, constant);
|
59
|
+
assert(memcmp(out, out2, crypto_core_hchacha20_OUTPUTBYTES) == 0);
|
60
|
+
|
61
|
+
sodium_free(out2);
|
62
|
+
sodium_free(out);
|
63
|
+
sodium_free(in);
|
64
|
+
sodium_free(key);
|
65
|
+
sodium_free(constant);
|
66
|
+
|
67
|
+
assert(crypto_core_hchacha20_outputbytes() == crypto_core_hchacha20_OUTPUTBYTES);
|
68
|
+
assert(crypto_core_hchacha20_inputbytes() == crypto_core_hchacha20_INPUTBYTES);
|
69
|
+
assert(crypto_core_hchacha20_keybytes() == crypto_core_hchacha20_KEYBYTES);
|
70
|
+
assert(crypto_core_hchacha20_constbytes() == crypto_core_hchacha20_CONSTBYTES);
|
71
|
+
|
72
|
+
printf("tv_hchacha20: ok\n");
|
73
|
+
}
|
74
|
+
|
75
|
+
#define XCHACHA20_OUT_MAX 100
|
76
|
+
|
77
|
+
typedef struct XChaCha20TV_ {
|
78
|
+
const char key[crypto_stream_xchacha20_KEYBYTES * 2 + 1];
|
79
|
+
const char nonce[crypto_stream_xchacha20_NONCEBYTES * 2 + 1];
|
80
|
+
const char out[XCHACHA20_OUT_MAX * 2 + 1];
|
81
|
+
} XChaCha20TV;
|
82
|
+
|
83
|
+
static void
|
84
|
+
tv_stream_xchacha20(void)
|
85
|
+
{
|
86
|
+
static const XChaCha20TV tvs[] = {
|
87
|
+
{ "79c99798ac67300bbb2704c95c341e3245f3dcb21761b98e52ff45b24f304fc4", "b33ffd3096479bcfbc9aee49417688a0a2554f8d95389419", "c6e9758160083ac604ef90e712ce6e75d7797590744e0cf060f013739c" },
|
88
|
+
{ "ddf7784fee099612c40700862189d0397fcc4cc4b3cc02b5456b3a97d1186173", "a9a04491e7bf00c3ca91ac7c2d38a777d88993a7047dfcc4", "2f289d371f6f0abc3cb60d11d9b7b29adf6bc5ad843e8493e928448d" },
|
89
|
+
{ "3d12800e7b014e88d68a73f0a95b04b435719936feba60473f02a9e61ae60682", "56bed2599eac99fb27ebf4ffcb770a64772dec4d5849ea2d", "a2c3c1406f33c054a92760a8e0666b84f84fa3a618f0" },
|
90
|
+
{ "5f5763ff9a30c95da5c9f2a8dfd7cc6efd9dfb431812c075aa3e4f32e04f53e4", "a5fa890efa3b9a034d377926ce0e08ee6d7faccaee41b771", "8a1a5ba898bdbcff602b1036e469a18a5e45789d0e8d9837d81a2388a52b0b6a0f51891528f424c4a7f492a8dd7bce8bac19fbdbe1fb379ac0" },
|
91
|
+
{ "eadc0e27f77113b5241f8ca9d6f9a5e7f09eee68d8a5cf30700563bf01060b4e", "a171a4ef3fde7c4794c5b86170dc5a099b478f1b852f7b64", "23839f61795c3cdbcee2c749a92543baeeea3cbb721402aa42e6cae140447575f2916c5d71108e3b13357eaf86f060cb" },
|
92
|
+
{ "91319c9545c7c804ba6b712e22294c386fe31c4ff3d278827637b959d3dbaab2", "410e854b2a911f174aaf1a56540fc3855851f41c65967a4e", "cbe7d24177119b7fdfa8b06ee04dade4256ba7d35ffda6b89f014e479faef6" },
|
93
|
+
{ "6a6d3f412fc86c4450fc31f89f64ed46baa3256ffcf8616e8c23a06c422842b6", "6b7773fce3c2546a5db4829f53a9165f41b08faae2fb72d5", "8b23e35b3cdd5f3f75525fc37960ec2b68918e8c046d8a832b9838f1546be662e54feb1203e2" },
|
94
|
+
{ "d45e56368ebc7ba9be7c55cfd2da0feb633c1d86cab67cd5627514fd20c2b391", "fd37da2db31e0c738754463edadc7dafb0833bd45da497fc", "47950efa8217e3dec437454bd6b6a80a287e2570f0a48b3fa1ea3eb868be3d486f6516606d85e5643becc473b370871ab9ef8e2a728f73b92bd98e6e26ea7c8ff96ec5a9e8de95e1eee9300c" },
|
95
|
+
{ "aface41a64a9a40cbc604d42bd363523bd762eb717f3e08fe2e0b4611eb4dcf3", "6906e0383b895ab9f1cf3803f42f27c79ad47b681c552c63", "a5fa7c0190792ee17675d52ad7570f1fb0892239c76d6e802c26b5b3544d13151e67513b8aaa1ac5af2d7fd0d5e4216964324838" },
|
96
|
+
{ "9d23bd4149cb979ccf3c5c94dd217e9808cb0e50cd0f67812235eaaf601d6232", "c047548266b7c370d33566a2425cbf30d82d1eaf5294109e", "a21209096594de8c5667b1d13ad93f744106d054df210e4782cd396fec692d3515a20bf351eec011a92c367888bc464c32f0807acd6c203a247e0db854148468e9f96bee4cf718d68d5f637cbd5a376457788e6fae90fc31097cfc" },
|
97
|
+
};
|
98
|
+
const XChaCha20TV *tv;
|
99
|
+
char *hex;
|
100
|
+
unsigned char *key;
|
101
|
+
unsigned char *nonce;
|
102
|
+
unsigned char *out;
|
103
|
+
unsigned char *out2;
|
104
|
+
size_t out_len;
|
105
|
+
int i;
|
106
|
+
|
107
|
+
key = (unsigned char *) sodium_malloc(crypto_stream_xchacha20_KEYBYTES);
|
108
|
+
nonce = (unsigned char *) sodium_malloc(crypto_stream_xchacha20_NONCEBYTES);
|
109
|
+
out = (unsigned char *) sodium_malloc(XCHACHA20_OUT_MAX);
|
110
|
+
for (i = 0; i < (sizeof tvs) / (sizeof tvs[0]); i++) {
|
111
|
+
tv = &tvs[i];
|
112
|
+
|
113
|
+
sodium_hex2bin(key, crypto_stream_xchacha20_KEYBYTES,
|
114
|
+
tv->key, strlen(tv->key), NULL, NULL, NULL);
|
115
|
+
sodium_hex2bin(nonce, crypto_stream_xchacha20_NONCEBYTES,
|
116
|
+
tv->nonce, strlen(tv->nonce), NULL, NULL, NULL);
|
117
|
+
sodium_hex2bin(out, XCHACHA20_OUT_MAX,
|
118
|
+
tv->out, strlen(tv->out), NULL, &out_len, NULL);
|
119
|
+
out2 = (unsigned char *) sodium_malloc(out_len);
|
120
|
+
crypto_stream_xchacha20(out2, out_len, nonce, key);
|
121
|
+
assert(memcmp(out, out2, out_len) == 0);
|
122
|
+
crypto_stream_xchacha20_xor(out2, out, out_len, nonce, key);
|
123
|
+
assert(sodium_is_zero(out2, out_len));
|
124
|
+
crypto_stream_xchacha20_xor_ic(out2, out, out_len, nonce, 0, key);
|
125
|
+
assert(sodium_is_zero(out2, out_len));
|
126
|
+
crypto_stream_xchacha20_xor_ic(out2, out, out_len, nonce, 1, key);
|
127
|
+
assert(!sodium_is_zero(out2, out_len));
|
128
|
+
crypto_stream_xchacha20_xor(out, out, out_len, nonce, key);
|
129
|
+
assert(sodium_is_zero(out, out_len));
|
130
|
+
sodium_free(out2);
|
131
|
+
}
|
132
|
+
|
133
|
+
out2 = (unsigned char *) sodium_malloc(0);
|
134
|
+
crypto_stream_xchacha20(out2, 0, nonce, key);
|
135
|
+
crypto_stream_xchacha20_xor(out2, out2, 0, nonce, key);
|
136
|
+
crypto_stream_xchacha20_xor_ic(out2, out2, 0, nonce, 1, key);
|
137
|
+
sodium_free(out2);
|
138
|
+
sodium_free(out);
|
139
|
+
|
140
|
+
out = (unsigned char *) sodium_malloc(64);
|
141
|
+
out2 = (unsigned char *) sodium_malloc(128);
|
142
|
+
randombytes_buf(out, 64);
|
143
|
+
randombytes_buf(out2, 64);
|
144
|
+
memcpy(out2 + 64, out, 64);
|
145
|
+
crypto_stream_xchacha20_xor_ic(out, out, 64, nonce, 1, key);
|
146
|
+
crypto_stream_xchacha20_xor(out2, out2, 128, nonce, key);
|
147
|
+
assert(memcmp(out, out2 + 64, 64) == 0);
|
148
|
+
sodium_free(out);
|
149
|
+
sodium_free(out2);
|
150
|
+
|
151
|
+
out = (unsigned char *) sodium_malloc(192);
|
152
|
+
out2 = (unsigned char *) sodium_malloc(192);
|
153
|
+
memset(out, 0, 192);
|
154
|
+
memset(out2, 0, 192);
|
155
|
+
crypto_stream_xchacha20_xor_ic(out2, out2, 192, nonce,
|
156
|
+
(1ULL << 32) - 1ULL, key);
|
157
|
+
crypto_stream_xchacha20_xor_ic(out, out, 64, nonce,
|
158
|
+
(1ULL << 32) - 1ULL, key);
|
159
|
+
crypto_stream_xchacha20_xor_ic(out + 64, out + 64, 64, nonce,
|
160
|
+
(1ULL << 32), key);
|
161
|
+
crypto_stream_xchacha20_xor_ic(out + 128, out + 128, 64, nonce,
|
162
|
+
(1ULL << 32) + 1, key);
|
163
|
+
assert(memcmp(out, out2, 192) == 0);
|
164
|
+
hex = (char *) sodium_malloc(192 * 2 + 1);
|
165
|
+
sodium_bin2hex(hex, 192 * 2 + 1, out, 192);
|
166
|
+
printf("%s\n", hex);
|
167
|
+
sodium_free(hex);
|
168
|
+
sodium_free(out);
|
169
|
+
sodium_free(out2);
|
170
|
+
|
171
|
+
sodium_free(nonce);
|
172
|
+
sodium_free(key);
|
173
|
+
|
174
|
+
assert(crypto_stream_xchacha20_keybytes() == crypto_stream_xchacha20_KEYBYTES);
|
175
|
+
assert(crypto_stream_xchacha20_noncebytes() == crypto_stream_xchacha20_NONCEBYTES);
|
176
|
+
|
177
|
+
printf("tv_stream_xchacha20: ok\n");
|
178
|
+
}
|
179
|
+
|
180
|
+
typedef struct XChaCha20Poly1305TV_ {
|
181
|
+
const char key[crypto_secretbox_xchacha20poly1305_KEYBYTES * 2 + 1];
|
182
|
+
const char nonce[crypto_secretbox_xchacha20poly1305_NONCEBYTES * 2 + 1];
|
183
|
+
const char *m;
|
184
|
+
const char *out;
|
185
|
+
} XChaCha20Poly1305TV;
|
186
|
+
|
187
|
+
static void
|
188
|
+
tv_secretbox_xchacha20poly1305(void)
|
189
|
+
{
|
190
|
+
static const XChaCha20Poly1305TV tvs[] = {
|
191
|
+
{ "065ff46a9dddb1ab047ee5914d6d575a828b8cc1f454b24e8cd0f57efdc49a34", "f83262646ce01293b9923a65a073df78c54b2e799cd6c4e5", "", "4c72340416339dcdea01b760db5adaf7" },
|
192
|
+
{ "d3c71d54e6b13506e07aa2e7b412a17a7a1f34df3d3148cd3f45b91ccaa5f4d9", "943b454a853aa514c63cf99b1e197bbb99da24b2e2d93e47", "76bd706e07741e713d90efdb34ad202067263f984942aae8bda159f30dfccc72200f8093520b85c5ad124ff7c8b2d920946e5cfff4b819abf84c7b35a6205ca72c9f8747c3044dd73fb4bebda1b476", "0384276f1cfa5c82c3e58f0f2acc1f821c6f526d2c19557cf8bd270fcde43fba1d88890663f7b2f5c6b1d7deccf5c91b4df5865dc55cc7e04d6793fc2db8f9e3b418f95cb796d67a7f3f7e097150cb607c435dacf82eac3d669866e5092ace" },
|
193
|
+
{ "9498fdb922e0596e32af7f8108def2068f5a32a5ac70bd33ade371701f3d98d0", "a0056f24be0d20106fe750e2ee3684d4457cbdcb3a74e566", "b1bc9cfedb340fb06a37eba80439189e48aa0cfd37020eec0afa09165af12864671b3fbddbbb20ac18f586f2f66d13b3ca40c9a7e21c4513a5d87a95319f8ca3c2151e2a1b8b86a35653e77f90b9e63d2a84be9b9603876a89d60fd708edcd64b41be1064b8ad1046553aaeb51dc70b8112c9915d94f2a5dad1e14e7009db6c703c843a4f64b77d44b179b9579ac497dac2d33", "4918790d46893fa3dca74d8abc57eef7fca2c6393d1beef5efa845ac20475db38d1a068debf4c5dbd8614eb072877c565dc52bd40941f0b590d2079a5028e426bf50bcbaadcbebf278bddceedc578a5e31379523dee15026ec82d34e56f2871fdf13255db199ac48f163d5ee7e4f4e09a39451356959d9242a39aea33990ab960a4c25346e3d9397fc5e7cb6266c2476411cd331f2bcb4486750c746947ec6401865d5" },
|
194
|
+
{ "fa2d915e044d0519248150e7c815b01f0f2a691c626f8d22c3ef61e7f16eea47", "c946065dc8befa9cc9f292ea2cf28f0256285565051792b7", "d5be1a24c7872115dc5c5b4234dbee35a6f89ae3a91b3e33d75249a0aecfed252341295f49296f7ee14d64de1ea6355cb8facd065052d869aeb1763cda7e418a7e33b6f7a81327181df6cd4de3a126d9df1b5e8b0b1a6b281e63f2", "6d32e3571afec58b0acabb54a287118b3ed6691f56cc8ead12d735352c9a050c2ca173c78b6092f9ad4b7c21c36fb0ce18560956395bab3099c54760a743051ac6a898a0b0034b5e953340c975cf7a873c56b27e66bca2bff1dd977addefc7935bb7550753dd13d1f1a43d" },
|
195
|
+
{ "6f149c2ec27af45176030c8dd7ab0e1e488f5803f26f75045d7a56f59a587a85", "952aff2f39bc70016f04ac7fb8b55fd22764ba16b56e255d", "8fde598c4bde5786abdc6ab83fce66d59782b6ce36afe028c447ad4086a748764afa88a520e837a9d56d0b7693b0476649f24c2aa44b94615a1efc75", "9bccf07974836fa4609d32d9527d928d184d9c6c0823af2f703e0e257a162d26d3678fa15ab1c4db76ac42084d32cefca8efaf77814c199b310999e327a3e3daa2e235b175979504ede87b58" },
|
196
|
+
{ "b964b7fdf442efbcc2cd3e4cd596035bdfb05ed7d44f7fd4dce2d5614af5c8c4", "2886fbfa4b35b68f28d31df6243a4fbc56475b69e24820a4", "", "b83fbdd112bf0f7d62eff96c9faa8850" },
|
197
|
+
{ "10c0ad4054b48d7d1de1d9ab6f782ca883d886573e9d18c1d47b6ee6b5208189", "977edf57428d0e0247a3c88c9a9ec321bbaae1a4da8353b5", "518e4a27949812424b2a381c3efea6055ee5e75eff", "0c801a037c2ed0500d6ef68e8d195eceb05a15f8edb68b35773e81ac2aca18e9be53416f9a" },
|
198
|
+
{ "7db0a81d01699c86f47a3ec76d46aa32660adad7f9ac72cf8396419f789f6bb1", "e7cb57132ce954e28f4470cca1dbda20b534cdf32fbe3658", "ee6511d403539e611ab312205f0c3b8f36a33d36f1dc44bb33d6836f0ab93b9f1747167bf0150f045fcd12a39479641d8bdde6fe01475196e8fe2c435e834e30a59f6aaa01ebcd", "ae8b1d4df4f982b2702626feca07590fedd0dfa7ae34e6a098372a1aa32f9fbf0ce2a88b5c16a571ef48f3c9fda689ce8ebb9947c9e2a28e01b1191efc81ad2ce0ed6e6fc7c164b1fc7f3d50b7f5e47a895db3c1fc46c0" },
|
199
|
+
{ "7b043dd27476cf5a2baf2907541d8241ecd8b97d38d08911737e69b0846732fb", "74706a2855f946ed600e9b453c1ac372520b6a76a3c48a76", "dbf165bb8352d6823991b99f3981ba9c8153635e5695477cba54e96a2a8c4dc5f9dbe817887d7340e3f48a", "ce57261afba90a9598de15481c43f26f7b8c8cb2806c7c977752dba898dc51b92a3f1a62ebf696747bfccf72e0edda97f2ccd6d496f55aefbb3ec2" },
|
200
|
+
{ "e588e418d658df1b2b1583122e26f74ca3506b425087bea895d81021168f8164", "4f4d0ffd699268cd841ce4f603fe0cd27b8069fcf8215fbb", "f91bcdcf4d08ba8598407ba8ef661e66c59ca9d89f3c0a3542e47246c777091e4864e63e1e3911dc01257255e551527a53a34481be", "22dc88de7cacd4d9ce73359f7d6e16e74caeaa7b0d1ef2bb10fda4e79c3d5a9aa04b8b03575fd27bc970c9ed0dc80346162469e0547030ddccb8cdc95981400907c87c9442" }
|
201
|
+
};
|
202
|
+
const XChaCha20Poly1305TV *tv;
|
203
|
+
unsigned char *m;
|
204
|
+
unsigned char *nonce;
|
205
|
+
unsigned char *key;
|
206
|
+
unsigned char *out;
|
207
|
+
unsigned char *out2;
|
208
|
+
size_t m_len;
|
209
|
+
size_t out_len;
|
210
|
+
size_t n;
|
211
|
+
int i;
|
212
|
+
|
213
|
+
key = (unsigned char *) sodium_malloc
|
214
|
+
(crypto_secretbox_xchacha20poly1305_KEYBYTES);
|
215
|
+
nonce = (unsigned char *) sodium_malloc
|
216
|
+
(crypto_secretbox_xchacha20poly1305_NONCEBYTES);
|
217
|
+
for (i = 0; i < (sizeof tvs) / (sizeof tvs[0]); i++) {
|
218
|
+
tv = &tvs[i];
|
219
|
+
m_len = strlen(tv->m) / 2;
|
220
|
+
m = (unsigned char *) sodium_malloc(m_len);
|
221
|
+
sodium_hex2bin(key, crypto_secretbox_xchacha20poly1305_KEYBYTES,
|
222
|
+
tv->key, strlen(tv->key), NULL, NULL, NULL);
|
223
|
+
sodium_hex2bin(nonce, crypto_secretbox_xchacha20poly1305_NONCEBYTES,
|
224
|
+
tv->nonce, strlen(tv->nonce), NULL, NULL, NULL);
|
225
|
+
sodium_hex2bin(m, m_len, tv->m, strlen(tv->m), NULL, NULL, NULL);
|
226
|
+
out = (unsigned char *) sodium_malloc
|
227
|
+
(crypto_secretbox_xchacha20poly1305_MACBYTES + m_len);
|
228
|
+
out2 = (unsigned char *) sodium_malloc
|
229
|
+
(crypto_secretbox_xchacha20poly1305_MACBYTES + m_len);
|
230
|
+
sodium_hex2bin(out, crypto_secretbox_xchacha20poly1305_MACBYTES + m_len,
|
231
|
+
tv->out, strlen(tv->out), NULL, NULL, NULL);
|
232
|
+
crypto_secretbox_xchacha20poly1305_easy(out2, m, m_len, nonce, key);
|
233
|
+
assert(memcmp(out, out2,
|
234
|
+
crypto_secretbox_xchacha20poly1305_MACBYTES + m_len) == 0);
|
235
|
+
n = randombytes_uniform(crypto_secretbox_xchacha20poly1305_MACBYTES + m_len);
|
236
|
+
out2[n]++;
|
237
|
+
assert(crypto_secretbox_xchacha20poly1305_open_easy
|
238
|
+
(out2, out2, crypto_secretbox_xchacha20poly1305_MACBYTES + m_len,
|
239
|
+
nonce, key) == -1);
|
240
|
+
out2[n]--;
|
241
|
+
nonce[0]++;
|
242
|
+
assert(crypto_secretbox_xchacha20poly1305_open_easy
|
243
|
+
(out2, out2, crypto_secretbox_xchacha20poly1305_MACBYTES + m_len,
|
244
|
+
nonce, key) == -1);
|
245
|
+
nonce[0]--;
|
246
|
+
assert(crypto_secretbox_xchacha20poly1305_open_easy
|
247
|
+
(out2, out2, crypto_secretbox_xchacha20poly1305_MACBYTES + m_len,
|
248
|
+
nonce, key) == 0);
|
249
|
+
assert(memcmp(m, out2, m_len) == 0);
|
250
|
+
assert(crypto_secretbox_xchacha20poly1305_open_detached
|
251
|
+
(out2, out + crypto_secretbox_xchacha20poly1305_MACBYTES, out,
|
252
|
+
m_len, nonce, key) == 0);
|
253
|
+
crypto_secretbox_xchacha20poly1305_detached
|
254
|
+
(out2 + crypto_secretbox_xchacha20poly1305_MACBYTES, out2, m,
|
255
|
+
m_len, nonce, key);
|
256
|
+
assert(memcmp(out, out2,
|
257
|
+
crypto_secretbox_xchacha20poly1305_MACBYTES + m_len) == 0);
|
258
|
+
sodium_free(out);
|
259
|
+
sodium_free(out2);
|
260
|
+
sodium_free(m);
|
261
|
+
}
|
262
|
+
sodium_free(nonce);
|
263
|
+
sodium_free(key);
|
264
|
+
|
265
|
+
assert(crypto_secretbox_xchacha20poly1305_keybytes() == crypto_secretbox_xchacha20poly1305_KEYBYTES);
|
266
|
+
assert(crypto_secretbox_xchacha20poly1305_noncebytes() == crypto_secretbox_xchacha20poly1305_NONCEBYTES);
|
267
|
+
assert(crypto_secretbox_xchacha20poly1305_macbytes() == crypto_secretbox_xchacha20poly1305_MACBYTES);
|
268
|
+
|
269
|
+
printf("tv_secretbox_xchacha20: ok\n");
|
270
|
+
}
|
271
|
+
|
272
|
+
static void
|
273
|
+
tv_box_xchacha20poly1305(void)
|
274
|
+
{
|
275
|
+
char hex[65];
|
276
|
+
unsigned char *pk;
|
277
|
+
unsigned char *sk;
|
278
|
+
unsigned char *m;
|
279
|
+
unsigned char *m2;
|
280
|
+
unsigned char *mac;
|
281
|
+
unsigned char *nonce;
|
282
|
+
unsigned char *out;
|
283
|
+
unsigned char *pc;
|
284
|
+
unsigned char *seed;
|
285
|
+
size_t m_len;
|
286
|
+
int i;
|
287
|
+
|
288
|
+
pk = (unsigned char *) sodium_malloc(crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES);
|
289
|
+
sk = (unsigned char *) sodium_malloc(crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES);
|
290
|
+
nonce = (unsigned char *) sodium_malloc(crypto_box_curve25519xchacha20poly1305_NONCEBYTES);
|
291
|
+
mac = (unsigned char *) sodium_malloc(crypto_box_curve25519xchacha20poly1305_MACBYTES);
|
292
|
+
pc = (unsigned char *) sodium_malloc(crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES);
|
293
|
+
for (i = 0; i < 10; i++) {
|
294
|
+
m_len = (i == 0) ? 0 : randombytes_uniform(150);
|
295
|
+
m = (unsigned char *) sodium_malloc(m_len);
|
296
|
+
m2 = (unsigned char *) sodium_malloc(m_len);
|
297
|
+
|
298
|
+
out = (unsigned char *) sodium_malloc
|
299
|
+
(crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len);
|
300
|
+
randombytes_buf(nonce, crypto_box_curve25519xchacha20poly1305_NONCEBYTES);
|
301
|
+
randombytes_buf(m, m_len);
|
302
|
+
assert(crypto_box_curve25519xchacha20poly1305_keypair(pk, sk) == 0);
|
303
|
+
assert(crypto_box_curve25519xchacha20poly1305_easy(out, m, m_len, nonce,
|
304
|
+
pk, sk) == 0);
|
305
|
+
assert(crypto_box_curve25519xchacha20poly1305_open_easy
|
306
|
+
(m2, out, crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len,
|
307
|
+
nonce, pk, sk) == 0);
|
308
|
+
assert(memcmp(m2, m, m_len) == 0);
|
309
|
+
sodium_free(out);
|
310
|
+
|
311
|
+
out = (unsigned char *) sodium_malloc
|
312
|
+
(crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len);
|
313
|
+
assert(crypto_box_curve25519xchacha20poly1305_beforenm(pc, pk, sk) == 0);
|
314
|
+
assert(crypto_box_curve25519xchacha20poly1305_easy_afternm
|
315
|
+
(out, m, m_len, nonce, pc) == 0);
|
316
|
+
assert(crypto_box_curve25519xchacha20poly1305_open_easy_afternm
|
317
|
+
(m2, out, crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len,
|
318
|
+
nonce, pc) == 0);
|
319
|
+
assert(memcmp(m2, m, m_len) == 0);
|
320
|
+
sodium_free(out);
|
321
|
+
|
322
|
+
out = (unsigned char *) sodium_malloc(m_len);
|
323
|
+
assert(crypto_box_curve25519xchacha20poly1305_detached(out, mac, m, m_len,
|
324
|
+
nonce, pk, sk) == 0);
|
325
|
+
assert(crypto_box_curve25519xchacha20poly1305_open_detached
|
326
|
+
(m2, out, mac, m_len, nonce, pk, sk) == 0);
|
327
|
+
sodium_free(out);
|
328
|
+
|
329
|
+
out = (unsigned char *) sodium_malloc(m_len);
|
330
|
+
assert(crypto_box_curve25519xchacha20poly1305_detached_afternm
|
331
|
+
(out, mac, m, m_len, nonce, pc) == 0);
|
332
|
+
assert(crypto_box_curve25519xchacha20poly1305_open_detached_afternm
|
333
|
+
(m2, out, mac, m_len, nonce, pc) == 0);
|
334
|
+
sodium_free(out);
|
335
|
+
|
336
|
+
sodium_free(m2);
|
337
|
+
sodium_free(m);
|
338
|
+
}
|
339
|
+
sodium_free(pc);
|
340
|
+
sodium_free(mac);
|
341
|
+
sodium_free(nonce);
|
342
|
+
|
343
|
+
seed = (unsigned char *) sodium_malloc
|
344
|
+
(crypto_box_curve25519xchacha20poly1305_SEEDBYTES);
|
345
|
+
for (i = 0; i < crypto_box_curve25519xchacha20poly1305_SEEDBYTES; i++) {
|
346
|
+
seed[i] = i;
|
347
|
+
}
|
348
|
+
crypto_box_curve25519xchacha20poly1305_seed_keypair(pk, sk, seed);
|
349
|
+
sodium_bin2hex(hex, sizeof hex, pk, crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES);
|
350
|
+
assert(strcmp(hex, "4701d08488451f545a409fb58ae3e58581ca40ac3f7f114698cd71deac73ca01") == 0);
|
351
|
+
sodium_bin2hex(hex, sizeof hex, sk, crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES);
|
352
|
+
assert(strcmp(hex, "3d94eea49c580aef816935762be049559d6d1440dede12e6a125f1841fff8e6f") == 0);
|
353
|
+
sodium_free(seed);
|
354
|
+
|
355
|
+
sodium_free(sk);
|
356
|
+
sodium_free(pk);
|
357
|
+
|
358
|
+
assert(crypto_box_curve25519xchacha20poly1305_seedbytes() == crypto_box_curve25519xchacha20poly1305_SEEDBYTES);
|
359
|
+
assert(crypto_box_curve25519xchacha20poly1305_publickeybytes() == crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES);
|
360
|
+
assert(crypto_box_curve25519xchacha20poly1305_secretkeybytes() == crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES);
|
361
|
+
assert(crypto_box_curve25519xchacha20poly1305_beforenmbytes() == crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES);
|
362
|
+
assert(crypto_box_curve25519xchacha20poly1305_noncebytes() == crypto_box_curve25519xchacha20poly1305_NONCEBYTES);
|
363
|
+
|
364
|
+
printf("tv_box_xchacha20poly1305: ok\n");
|
365
|
+
}
|
366
|
+
|
367
|
+
int
|
368
|
+
main(void)
|
369
|
+
{
|
370
|
+
tv_hchacha20();
|
371
|
+
tv_stream_xchacha20();
|
372
|
+
tv_secretbox_xchacha20poly1305();
|
373
|
+
tv_box_xchacha20poly1305();
|
374
|
+
|
375
|
+
return 0;
|
376
|
+
}
|