rbnacl-libsodium 1.0.6 → 1.0.7
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 +10 -3
- data/vendor/libsodium/ChangeLog +19 -1
- data/vendor/libsodium/Makefile.in +1 -0
- data/vendor/libsodium/README.markdown +1 -1
- data/vendor/libsodium/THANKS +1 -0
- data/vendor/libsodium/autogen.sh +24 -4
- data/vendor/libsodium/autom4te.cache/output.1 +208 -24
- data/vendor/libsodium/autom4te.cache/output.5 +208 -24
- data/vendor/libsodium/autom4te.cache/requests +869 -869
- data/vendor/libsodium/autom4te.cache/traces.1 +426 -406
- data/vendor/libsodium/autom4te.cache/traces.5 +255 -245
- data/vendor/libsodium/builds/msvc/version.h +2 -2
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +14 -44
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +36 -132
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +14 -44
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +36 -132
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +14 -44
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +36 -132
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +14 -44
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +62 -158
- data/vendor/libsodium/configure +208 -24
- data/vendor/libsodium/configure.ac +70 -15
- data/vendor/libsodium/dist-build/Makefile.in +1 -0
- data/vendor/libsodium/dist-build/emscripten.sh +52 -19
- data/vendor/libsodium/dist-build/ios.sh +8 -8
- data/vendor/libsodium/dist-build/msys2-win32.sh +2 -1
- data/vendor/libsodium/dist-build/msys2-win64.sh +2 -1
- data/vendor/libsodium/dist-build/osx.sh +2 -2
- data/vendor/libsodium/examples/box.c +3 -1
- data/vendor/libsodium/examples/box_detached.c +4 -2
- data/vendor/libsodium/examples/utils.h +3 -1
- data/vendor/libsodium/libsodium.vcxproj +13 -13
- data/vendor/libsodium/libsodium.vcxproj.filters +31 -35
- data/vendor/libsodium/msvc-scripts/Makefile.in +1 -0
- data/vendor/libsodium/msvc-scripts/process.bat +2 -2
- data/vendor/libsodium/src/Makefile.in +1 -0
- data/vendor/libsodium/src/libsodium/Makefile.am +43 -45
- data/vendor/libsodium/src/libsodium/Makefile.in +250 -249
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +28 -22
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +3 -4
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +3 -4
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c +4 -4
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c +4 -4
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c +6 -4
- data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +6 -2
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +5 -3
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c +13 -9
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +2 -2
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +36 -26
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +1 -2
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +2 -3
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +2 -3
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/{auth_poly1305_donna.c → poly1305_donna.c} +18 -11
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +1 -5
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +10 -9
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +17 -9
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +10 -1
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +708 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h +31 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c +11 -12
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/{smult_curve25519_donna_c64.c → curve25519_donna_c64.c} +32 -15
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.c +73 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S +25 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h +20 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +114 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h +25 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h +33 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +57 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S +189 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h +16 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +165 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +219 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +76 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +1432 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h +18 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S +1287 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h +18 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S +17 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +67 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +3 -2
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +2 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +42 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +7 -7
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +113 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +10 -7
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +10 -10
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +10 -9
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +2 -3
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +72 -68
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/{api.h → stream_chacha20_ref.h} +5 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/{stream_chacha20_api.c → stream_chacha20.c} +27 -7
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.h +22 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.c +329 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.h +27 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +1 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +4 -4
- data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c +14 -21
- data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c +14 -37
- data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/verify_64.c +14 -69
- data/vendor/libsodium/src/libsodium/include/Makefile.in +1 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +8 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +4 -2
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +2 -2
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +2 -3
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +2 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +6 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +5 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h +6 -20
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +1 -28
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h +1 -27
- data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +6 -0
- data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +3 -3
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +58 -51
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +23 -18
- data/vendor/libsodium/src/libsodium/sodium/core.c +4 -0
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +34 -15
- data/vendor/libsodium/src/libsodium/sodium/utils.c +104 -14
- data/vendor/libsodium/test/Makefile.in +1 -0
- data/vendor/libsodium/test/default/Makefile.in +1 -0
- data/vendor/libsodium/test/default/auth.c +5 -5
- data/vendor/libsodium/test/default/auth2.c +3 -3
- data/vendor/libsodium/test/default/auth3.c +3 -3
- data/vendor/libsodium/test/default/auth5.c +4 -4
- data/vendor/libsodium/test/default/auth6.c +3 -3
- data/vendor/libsodium/test/default/auth7.c +4 -4
- data/vendor/libsodium/test/default/box.c +13 -9
- data/vendor/libsodium/test/default/box2.c +11 -8
- data/vendor/libsodium/test/default/box7.c +11 -9
- data/vendor/libsodium/test/default/box8.c +32 -19
- data/vendor/libsodium/test/default/box_easy.c +31 -10
- data/vendor/libsodium/test/default/box_easy.exp +3 -19
- data/vendor/libsodium/test/default/box_easy2.c +30 -15
- data/vendor/libsodium/test/default/box_seed.c +1 -1
- data/vendor/libsodium/test/default/cmptest.h +22 -1
- data/vendor/libsodium/test/default/core1.c +6 -5
- data/vendor/libsodium/test/default/core2.c +6 -5
- data/vendor/libsodium/test/default/core3.c +8 -7
- data/vendor/libsodium/test/default/core4.c +11 -8
- data/vendor/libsodium/test/default/core5.c +7 -5
- data/vendor/libsodium/test/default/core6.c +8 -6
- data/vendor/libsodium/test/default/generichash.c +0 -15
- data/vendor/libsodium/test/default/generichash.exp +0 -1
- data/vendor/libsodium/test/default/generichash3.c +1 -21
- data/vendor/libsodium/test/default/generichash3.exp +1 -1
- data/vendor/libsodium/test/default/hash.c +3 -3
- data/vendor/libsodium/test/default/hash3.c +2 -2
- data/vendor/libsodium/test/default/index.html.tpl +84 -0
- data/vendor/libsodium/test/default/onetimeauth.c +3 -3
- data/vendor/libsodium/test/default/onetimeauth2.c +5 -4
- data/vendor/libsodium/test/default/onetimeauth7.c +4 -4
- data/vendor/libsodium/test/default/pre.js.inc +14 -6
- data/vendor/libsodium/test/default/randombytes.c +2 -2
- data/vendor/libsodium/test/default/scalarmult.c +19 -6
- data/vendor/libsodium/test/default/scalarmult.exp +1 -0
- data/vendor/libsodium/test/default/scalarmult2.c +2 -2
- data/vendor/libsodium/test/default/scalarmult5.c +6 -4
- data/vendor/libsodium/test/default/scalarmult6.c +5 -3
- data/vendor/libsodium/test/default/scalarmult7.c +11 -7
- data/vendor/libsodium/test/default/secretbox.c +7 -6
- data/vendor/libsodium/test/default/secretbox2.c +7 -6
- data/vendor/libsodium/test/default/secretbox7.c +5 -5
- data/vendor/libsodium/test/default/secretbox8.c +5 -5
- data/vendor/libsodium/test/default/secretbox_easy.c +27 -17
- data/vendor/libsodium/test/default/secretbox_easy.exp +7 -95
- data/vendor/libsodium/test/default/secretbox_easy2.c +22 -10
- data/vendor/libsodium/test/default/sign.c +5 -0
- data/vendor/libsodium/test/default/sodium_utils.c +73 -0
- data/vendor/libsodium/test/default/sodium_utils.exp +6 -0
- data/vendor/libsodium/test/default/stream.c +7 -6
- data/vendor/libsodium/test/default/stream2.c +4 -4
- data/vendor/libsodium/test/default/stream3.c +6 -5
- data/vendor/libsodium/test/default/stream4.c +7 -6
- data/vendor/libsodium/test/default/verify1.c +61 -18
- data/vendor/libsodium/test/default/verify1.exp +2 -6
- metadata +37 -44
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/api.h +0 -20
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/api.h +0 -2
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/api.h +0 -6
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/base_curve25519_donna_c64.c +0 -13
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/api.h +0 -5
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/base_curve25519_ref10.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/scalarmult_curve25519_ref10.c +0 -54
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/api.h +0 -11
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/api.h +0 -7
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +0 -15
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/api.h +0 -12
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519.h +0 -54
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519_edwards25519sha512batch.c +0 -348
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519.h +0 -34
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519_edwards25519sha512batch.c +0 -230
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519.h +0 -51
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c +0 -150
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c +0 -106
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/api.h +0 -13
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/api.h +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/api.h +0 -10
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/api.h +0 -11
- data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/api.h +0 -2
- data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/api.h +0 -2
- data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/api.h +0 -2
@@ -0,0 +1,18 @@
|
|
1
|
+
#ifndef ladder_base_H
|
2
|
+
#define ladder_base_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#include "fe.h"
|
9
|
+
#include "ladder_base_namespace.h"
|
10
|
+
|
11
|
+
extern void ladder_base(fe *, const unsigned char *);
|
12
|
+
|
13
|
+
#ifdef __cplusplus
|
14
|
+
}
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#endif //ifndef ladder_base_H
|
18
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
#ifdef HAVE_AVX_ASM
|
3
|
+
|
4
|
+
#define IN_SANDY2X
|
5
|
+
|
6
|
+
#include "consts.S"
|
7
|
+
#include "fe51_mul.S"
|
8
|
+
#include "fe51_nsquare.S"
|
9
|
+
#include "fe51_pack.S"
|
10
|
+
#include "ladder.S"
|
11
|
+
#include "ladder_base.S"
|
12
|
+
|
13
|
+
#if defined(__linux__) && defined(__ELF__)
|
14
|
+
.section .note.GNU-stack,"",%progbits
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#endif
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
#include "crypto_scalarmult_curve25519.h"
|
3
|
+
#include "scalarmult_curve25519.h"
|
4
|
+
#include "runtime.h"
|
5
|
+
|
6
|
+
#ifdef HAVE_AVX_ASM
|
7
|
+
# include "sandy2x/curve25519_sandy2x.h"
|
8
|
+
#endif
|
9
|
+
#ifdef HAVE_TI_MODE
|
10
|
+
# include "donna_c64/curve25519_donna_c64.h"
|
11
|
+
static const crypto_scalarmult_curve25519_implementation *implementation =
|
12
|
+
&crypto_scalarmult_curve25519_donna_c64_implementation;
|
13
|
+
#else
|
14
|
+
# include "ref10/curve25519_ref10.h"
|
15
|
+
static const crypto_scalarmult_curve25519_implementation *implementation =
|
16
|
+
&crypto_scalarmult_curve25519_ref10_implementation;
|
17
|
+
#endif
|
18
|
+
|
19
|
+
int
|
20
|
+
crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
|
21
|
+
const unsigned char *p)
|
22
|
+
{
|
23
|
+
size_t i;
|
24
|
+
unsigned char d = 0;
|
25
|
+
|
26
|
+
if (implementation->mult(q, n, p) != 0) {
|
27
|
+
return -1;
|
28
|
+
}
|
29
|
+
for (i = 0; i < crypto_scalarmult_curve25519_BYTES; i++) {
|
30
|
+
d |= q[i];
|
31
|
+
}
|
32
|
+
return -(1 & ((d - 1) >> 8));
|
33
|
+
}
|
34
|
+
|
35
|
+
int
|
36
|
+
crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n)
|
37
|
+
{
|
38
|
+
return implementation->mult_base(q, n);
|
39
|
+
}
|
40
|
+
|
41
|
+
size_t
|
42
|
+
crypto_scalarmult_curve25519_bytes(void)
|
43
|
+
{
|
44
|
+
return crypto_scalarmult_curve25519_BYTES;
|
45
|
+
}
|
46
|
+
|
47
|
+
size_t
|
48
|
+
crypto_scalarmult_curve25519_scalarbytes(void)
|
49
|
+
{
|
50
|
+
return crypto_scalarmult_curve25519_SCALARBYTES;
|
51
|
+
}
|
52
|
+
|
53
|
+
int
|
54
|
+
_crypto_scalarmult_curve25519_pick_best_implementation(void)
|
55
|
+
{
|
56
|
+
#ifdef HAVE_TI_MODE
|
57
|
+
implementation = &crypto_scalarmult_curve25519_donna_c64_implementation;
|
58
|
+
#else
|
59
|
+
implementation = &crypto_scalarmult_curve25519_ref10_implementation;
|
60
|
+
#endif
|
61
|
+
#ifdef HAVE_AVX_ASM
|
62
|
+
if (sodium_runtime_has_avx()) {
|
63
|
+
implementation = &crypto_scalarmult_curve25519_sandy2x_implementation;
|
64
|
+
}
|
65
|
+
#endif
|
66
|
+
return 0;
|
67
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
#ifndef scalarmult_poly1305_H
|
3
|
+
#define scalarmult_poly1305_H
|
4
|
+
|
5
|
+
typedef struct crypto_scalarmult_curve25519_implementation {
|
6
|
+
int (*mult)(unsigned char *q, const unsigned char *n,
|
7
|
+
const unsigned char *p);
|
8
|
+
int (*mult_base)(unsigned char *q, const unsigned char *n);
|
9
|
+
} crypto_scalarmult_curve25519_implementation;
|
10
|
+
|
11
|
+
#endif
|
data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#include "api.h"
|
2
1
|
#include "crypto_onetimeauth_poly1305.h"
|
2
|
+
#include "crypto_secretbox_xsalsa20poly1305.h"
|
3
3
|
#include "crypto_stream_xsalsa20.h"
|
4
4
|
|
5
|
-
int
|
5
|
+
int crypto_secretbox_xsalsa20poly1305(
|
6
6
|
unsigned char *c,
|
7
7
|
const unsigned char *m,unsigned long long mlen,
|
8
8
|
const unsigned char *n,
|
@@ -17,7 +17,7 @@ int crypto_secretbox(
|
|
17
17
|
return 0;
|
18
18
|
}
|
19
19
|
|
20
|
-
int
|
20
|
+
int crypto_secretbox_xsalsa20poly1305_open(
|
21
21
|
unsigned char *m,
|
22
22
|
const unsigned char *c,unsigned long long clen,
|
23
23
|
const unsigned char *n,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "
|
1
|
+
#include "crypto_shorthash_siphash24.h"
|
2
2
|
#include "crypto_uint64.h"
|
3
3
|
#include "crypto_uint32.h"
|
4
4
|
#include "crypto_uint8.h"
|
@@ -35,7 +35,8 @@ typedef crypto_uint8 u8;
|
|
35
35
|
v2 += v1; v1=ROTL(v1,17); v1 ^= v2; v2=ROTL(v2,32); \
|
36
36
|
} while(0)
|
37
37
|
|
38
|
-
int
|
38
|
+
int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in,
|
39
|
+
unsigned long long inlen, const unsigned char *k)
|
39
40
|
{
|
40
41
|
/* "somepseudorandomlygeneratedbytes" */
|
41
42
|
u64 v0 = 0x736f6d6570736575ULL;
|
@@ -70,6 +70,7 @@ typedef struct {
|
|
70
70
|
#define ge_sub crypto_sign_ed25519_ref10_ge_sub
|
71
71
|
#define ge_scalarmult_base crypto_sign_ed25519_ref10_ge_scalarmult_base
|
72
72
|
#define ge_double_scalarmult_vartime crypto_sign_ed25519_ref10_ge_double_scalarmult_vartime
|
73
|
+
#define ge_scalarmult_vartime crypto_sign_ed25519_ref10_ge_scalarmult_vartime
|
73
74
|
|
74
75
|
extern void ge_tobytes(unsigned char *,const ge_p2 *);
|
75
76
|
extern void ge_p3_tobytes(unsigned char *,const ge_p3 *);
|
@@ -91,5 +92,6 @@ extern void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *);
|
|
91
92
|
extern void ge_sub(ge_p1p1 *,const ge_p3 *,const ge_cached *);
|
92
93
|
extern void ge_scalarmult_base(ge_p3 *,const unsigned char *);
|
93
94
|
extern void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *);
|
95
|
+
extern void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *);
|
94
96
|
|
95
97
|
#endif
|
@@ -94,3 +94,45 @@ void ge_double_scalarmult_vartime(ge_p2 *r,const unsigned char *a,const ge_p3 *A
|
|
94
94
|
ge_p1p1_to_p2(r,&t);
|
95
95
|
}
|
96
96
|
}
|
97
|
+
|
98
|
+
void ge_scalarmult_vartime(ge_p3 *r,const unsigned char *a,const ge_p3 *A)
|
99
|
+
{
|
100
|
+
signed char aslide[256];
|
101
|
+
ge_cached Ai[8];
|
102
|
+
ge_p1p1 t;
|
103
|
+
ge_p3 u;
|
104
|
+
ge_p3 A2;
|
105
|
+
int i;
|
106
|
+
|
107
|
+
slide(aslide,a);
|
108
|
+
|
109
|
+
ge_p3_to_cached(&Ai[0],A);
|
110
|
+
ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t);
|
111
|
+
ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u);
|
112
|
+
ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u);
|
113
|
+
ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u);
|
114
|
+
ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u);
|
115
|
+
ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u);
|
116
|
+
ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u);
|
117
|
+
ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u);
|
118
|
+
|
119
|
+
ge_p3_0(r);
|
120
|
+
|
121
|
+
for (i = 255;i >= 0;--i) {
|
122
|
+
if (aslide[i]) break;
|
123
|
+
}
|
124
|
+
|
125
|
+
for (;i >= 0;--i) {
|
126
|
+
ge_p3_dbl(&t,r);
|
127
|
+
|
128
|
+
if (aslide[i] > 0) {
|
129
|
+
ge_p1p1_to_p3(&u,&t);
|
130
|
+
ge_add(&t,&u,&Ai[aslide[i]/2]);
|
131
|
+
} else if (aslide[i] < 0) {
|
132
|
+
ge_p1p1_to_p3(&u,&t);
|
133
|
+
ge_sub(&t,&u,&Ai[(-aslide[i])/2]);
|
134
|
+
}
|
135
|
+
|
136
|
+
ge_p1p1_to_p3(r,&t);
|
137
|
+
}
|
138
|
+
}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
#include <string.h>
|
3
3
|
|
4
|
-
#include "
|
4
|
+
#include "crypto_sign_ed25519.h"
|
5
5
|
#include "crypto_hash_sha512.h"
|
6
6
|
#include "crypto_scalarmult_curve25519.h"
|
7
|
-
#include "randombytes.h"
|
8
|
-
#include "utils.h"
|
9
7
|
#include "fe.h"
|
10
8
|
#include "ge.h"
|
9
|
+
#include "randombytes.h"
|
10
|
+
#include "utils.h"
|
11
11
|
|
12
|
-
int
|
13
|
-
|
12
|
+
int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk,
|
13
|
+
const unsigned char *seed)
|
14
14
|
{
|
15
15
|
ge_p3 A;
|
16
16
|
|
@@ -27,13 +27,13 @@ int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
|
|
27
27
|
return 0;
|
28
28
|
}
|
29
29
|
|
30
|
-
int
|
30
|
+
int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk)
|
31
31
|
{
|
32
32
|
unsigned char seed[32];
|
33
33
|
int ret;
|
34
34
|
|
35
35
|
randombytes_buf(seed, sizeof seed);
|
36
|
-
ret =
|
36
|
+
ret = crypto_sign_ed25519_seed_keypair(pk, sk, seed);
|
37
37
|
sodium_memzero(seed, sizeof seed);
|
38
38
|
|
39
39
|
return ret;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
|
2
|
+
#include <limits.h>
|
3
|
+
#include <stdint.h>
|
4
|
+
#include <string.h>
|
5
|
+
|
6
|
+
#include "crypto_hash_sha512.h"
|
7
|
+
#include "crypto_sign_edwards25519sha512batch.h"
|
8
|
+
#include "crypto_verify_32.h"
|
9
|
+
#include "fe.h"
|
10
|
+
#include "ge.h"
|
11
|
+
#include "randombytes.h"
|
12
|
+
#include "sc.h"
|
13
|
+
#include "utils.h"
|
14
|
+
|
15
|
+
int crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk,
|
16
|
+
unsigned char *sk)
|
17
|
+
{
|
18
|
+
ge_p3 A;
|
19
|
+
|
20
|
+
randombytes_buf(sk, 32);
|
21
|
+
crypto_hash_sha512(sk, sk, 32);
|
22
|
+
sk[0] &= 248;
|
23
|
+
sk[31] &= 63;
|
24
|
+
sk[31] |= 64;
|
25
|
+
ge_scalarmult_base(&A, sk);
|
26
|
+
ge_p3_tobytes(pk, &A);
|
27
|
+
|
28
|
+
return 0;
|
29
|
+
}
|
30
|
+
|
31
|
+
int crypto_sign_edwards25519sha512batch(unsigned char *sm,
|
32
|
+
unsigned long long *smlen_p,
|
33
|
+
const unsigned char *m,
|
34
|
+
unsigned long long mlen,
|
35
|
+
const unsigned char *sk)
|
36
|
+
{
|
37
|
+
crypto_hash_sha512_state hs;
|
38
|
+
unsigned char nonce[64];
|
39
|
+
unsigned char hram[64];
|
40
|
+
unsigned char sig[64];
|
41
|
+
ge_p3 A;
|
42
|
+
ge_p3 R;
|
43
|
+
|
44
|
+
crypto_hash_sha512_init(&hs);
|
45
|
+
crypto_hash_sha512_update(&hs, sk + 32, 32);
|
46
|
+
crypto_hash_sha512_update(&hs, m, mlen);
|
47
|
+
crypto_hash_sha512_final(&hs, nonce);
|
48
|
+
ge_scalarmult_base(&A, sk);
|
49
|
+
ge_p3_tobytes(sig + 32, &A);
|
50
|
+
sc_reduce(nonce);
|
51
|
+
ge_scalarmult_base(&R, nonce);
|
52
|
+
ge_p3_tobytes(sig, &R);
|
53
|
+
crypto_hash_sha512_init(&hs);
|
54
|
+
crypto_hash_sha512_update(&hs, sig, 32);
|
55
|
+
crypto_hash_sha512_update(&hs, m, mlen);
|
56
|
+
crypto_hash_sha512_final(&hs, hram);
|
57
|
+
sc_reduce(hram);
|
58
|
+
sc_muladd(sig + 32, hram, nonce, sk);
|
59
|
+
sodium_memzero(hram, sizeof hram);
|
60
|
+
memmove(sm + 32, m, (size_t) mlen);
|
61
|
+
memcpy(sm, sig, 32);
|
62
|
+
memcpy(sm + 32 + mlen, sig + 32, 32);
|
63
|
+
*smlen_p = mlen + 64U;
|
64
|
+
|
65
|
+
return 0;
|
66
|
+
}
|
67
|
+
|
68
|
+
int crypto_sign_edwards25519sha512batch_open(unsigned char *m,
|
69
|
+
unsigned long long *mlen_p,
|
70
|
+
const unsigned char *sm,
|
71
|
+
unsigned long long smlen,
|
72
|
+
const unsigned char *pk)
|
73
|
+
{
|
74
|
+
unsigned char h[64];
|
75
|
+
unsigned char t1[32], t2[32];
|
76
|
+
unsigned long long mlen;
|
77
|
+
ge_cached Ai;
|
78
|
+
ge_p1p1 csa;
|
79
|
+
ge_p2 cs;
|
80
|
+
ge_p3 A;
|
81
|
+
ge_p3 R;
|
82
|
+
ge_p3 cs3;
|
83
|
+
|
84
|
+
*mlen_p = 0;
|
85
|
+
if (smlen < 64 || smlen > SIZE_MAX) {
|
86
|
+
return -1;
|
87
|
+
}
|
88
|
+
mlen = smlen - 64;
|
89
|
+
if (sm[smlen - 1] & 224) {
|
90
|
+
return -1;
|
91
|
+
}
|
92
|
+
if (ge_frombytes_negate_vartime(&A, pk) != 0 ||
|
93
|
+
ge_frombytes_negate_vartime(&R, sm) != 0) {
|
94
|
+
return -1;
|
95
|
+
}
|
96
|
+
ge_p3_to_cached(&Ai, &A);
|
97
|
+
crypto_hash_sha512(h, sm, mlen + 32);
|
98
|
+
sc_reduce(h);
|
99
|
+
ge_scalarmult_vartime(&cs3, h, &R);
|
100
|
+
ge_add(&csa, &cs3, &Ai);
|
101
|
+
ge_p1p1_to_p2(&cs, &csa);
|
102
|
+
ge_tobytes(t1, &cs);
|
103
|
+
t1[31] ^= 1 << 7;
|
104
|
+
ge_scalarmult_base(&R, sm + 32 + mlen);
|
105
|
+
ge_p3_tobytes(t2, &R);
|
106
|
+
if (crypto_verify_32(t1, t2) != 0) {
|
107
|
+
return -1;
|
108
|
+
}
|
109
|
+
*mlen_p = mlen;
|
110
|
+
memmove(m, sm + 64, mlen);
|
111
|
+
|
112
|
+
return 0;
|
113
|
+
}
|
@@ -1,17 +1,20 @@
|
|
1
1
|
|
2
2
|
#include <limits.h>
|
3
|
+
#include <stdint.h>
|
3
4
|
#include <string.h>
|
4
5
|
|
5
|
-
#include "api.h"
|
6
6
|
#include "crypto_hash_sha512.h"
|
7
|
+
#include "crypto_sign_ed25519.h"
|
7
8
|
#include "crypto_verify_32.h"
|
8
9
|
#include "ge.h"
|
9
10
|
#include "sc.h"
|
10
11
|
#include "utils.h"
|
11
12
|
|
12
13
|
int
|
13
|
-
|
14
|
-
|
14
|
+
crypto_sign_ed25519_verify_detached(const unsigned char *sig,
|
15
|
+
const unsigned char *m,
|
16
|
+
unsigned long long mlen,
|
17
|
+
const unsigned char *pk)
|
15
18
|
{
|
16
19
|
crypto_hash_sha512_state hs;
|
17
20
|
unsigned char h[64];
|
@@ -48,9 +51,9 @@ crypto_sign_verify_detached(const unsigned char *sig, const unsigned char *m,
|
|
48
51
|
}
|
49
52
|
|
50
53
|
int
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
+
crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p,
|
55
|
+
const unsigned char *sm, unsigned long long smlen,
|
56
|
+
const unsigned char *pk)
|
54
57
|
{
|
55
58
|
unsigned long long mlen;
|
56
59
|
|
@@ -58,7 +61,7 @@ crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
|
|
58
61
|
goto badsig;
|
59
62
|
}
|
60
63
|
mlen = smlen - 64;
|
61
|
-
if (
|
64
|
+
if (crypto_sign_ed25519_verify_detached(sm, sm + 64, mlen, pk) != 0) {
|
62
65
|
memset(m, 0, mlen);
|
63
66
|
goto badsig;
|
64
67
|
}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
#include <string.h>
|
3
3
|
|
4
|
-
#include "api.h"
|
5
4
|
#include "crypto_hash_sha512.h"
|
5
|
+
#include "crypto_sign_ed25519.h"
|
6
6
|
#include "ge.h"
|
7
7
|
#include "sc.h"
|
8
8
|
#include "utils.h"
|
9
9
|
|
10
10
|
int
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
crypto_sign_ed25519_detached(unsigned char *sig, unsigned long long *siglen_p,
|
12
|
+
const unsigned char *m, unsigned long long mlen,
|
13
|
+
const unsigned char *sk)
|
14
14
|
{
|
15
15
|
crypto_hash_sha512_state hs;
|
16
16
|
unsigned char az[64];
|
@@ -43,7 +43,6 @@ crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
|
|
43
43
|
sc_muladd(sig + 32, hram, az, nonce);
|
44
44
|
|
45
45
|
sodium_memzero(az, sizeof az);
|
46
|
-
sodium_memzero(nonce, sizeof nonce);
|
47
46
|
|
48
47
|
if (siglen_p != NULL) {
|
49
48
|
*siglen_p = 64U;
|
@@ -52,16 +51,17 @@ crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
|
|
52
51
|
}
|
53
52
|
|
54
53
|
int
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p,
|
55
|
+
const unsigned char *m, unsigned long long mlen,
|
56
|
+
const unsigned char *sk)
|
58
57
|
{
|
59
58
|
unsigned long long siglen;
|
60
59
|
|
61
60
|
memmove(sm + crypto_sign_ed25519_BYTES, m, mlen);
|
62
61
|
/* LCOV_EXCL_START */
|
63
|
-
if (
|
64
|
-
|
62
|
+
if (crypto_sign_ed25519_detached(sm, &siglen,
|
63
|
+
sm + crypto_sign_ed25519_BYTES,
|
64
|
+
mlen, sk) != 0 ||
|
65
65
|
siglen != crypto_sign_ed25519_BYTES) {
|
66
66
|
if (smlen_p != NULL) {
|
67
67
|
*smlen_p = 0;
|