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,31 @@
|
|
1
|
+
#ifndef poly1305_sse2_H
|
2
|
+
#define poly1305_sse2_H
|
3
|
+
|
4
|
+
#include <stddef.h>
|
5
|
+
|
6
|
+
#include "crypto_onetimeauth_poly1305.h"
|
7
|
+
|
8
|
+
extern struct crypto_onetimeauth_poly1305_implementation
|
9
|
+
crypto_onetimeauth_poly1305_sse2_implementation;
|
10
|
+
|
11
|
+
static int crypto_onetimeauth_poly1305_sse2(unsigned char *out,
|
12
|
+
const unsigned char *in,
|
13
|
+
unsigned long long inlen,
|
14
|
+
const unsigned char *k);
|
15
|
+
|
16
|
+
static int crypto_onetimeauth_poly1305_sse2_verify(const unsigned char *h,
|
17
|
+
const unsigned char *in,
|
18
|
+
unsigned long long inlen,
|
19
|
+
const unsigned char *k);
|
20
|
+
|
21
|
+
static int crypto_onetimeauth_poly1305_sse2_init(crypto_onetimeauth_poly1305_state *state,
|
22
|
+
const unsigned char *key);
|
23
|
+
|
24
|
+
static int crypto_onetimeauth_poly1305_sse2_update(crypto_onetimeauth_poly1305_state *state,
|
25
|
+
const unsigned char *in,
|
26
|
+
unsigned long long inlen);
|
27
|
+
|
28
|
+
static int crypto_onetimeauth_poly1305_sse2_final(crypto_onetimeauth_poly1305_state *state,
|
29
|
+
unsigned char *out);
|
30
|
+
|
31
|
+
#endif /* poly1305_sse2_H */
|
@@ -1,18 +1,6 @@
|
|
1
1
|
|
2
2
|
#include "crypto_scalarmult.h"
|
3
3
|
|
4
|
-
size_t
|
5
|
-
crypto_scalarmult_bytes(void)
|
6
|
-
{
|
7
|
-
return crypto_scalarmult_BYTES;
|
8
|
-
}
|
9
|
-
|
10
|
-
size_t
|
11
|
-
crypto_scalarmult_scalarbytes(void)
|
12
|
-
{
|
13
|
-
return crypto_scalarmult_SCALARBYTES;
|
14
|
-
}
|
15
|
-
|
16
4
|
const char *
|
17
5
|
crypto_scalarmult_primitive(void)
|
18
6
|
{
|
@@ -32,3 +20,14 @@ crypto_scalarmult(unsigned char *q, const unsigned char *n,
|
|
32
20
|
return crypto_scalarmult_curve25519(q, n, p);
|
33
21
|
}
|
34
22
|
|
23
|
+
size_t
|
24
|
+
crypto_scalarmult_bytes(void)
|
25
|
+
{
|
26
|
+
return crypto_scalarmult_BYTES;
|
27
|
+
}
|
28
|
+
|
29
|
+
size_t
|
30
|
+
crypto_scalarmult_scalarbytes(void)
|
31
|
+
{
|
32
|
+
return crypto_scalarmult_SCALARBYTES;
|
33
|
+
}
|
@@ -24,10 +24,13 @@
|
|
24
24
|
|
25
25
|
#include <string.h>
|
26
26
|
#include <stdint.h>
|
27
|
-
#include "api.h"
|
28
27
|
|
29
28
|
#ifdef HAVE_TI_MODE
|
30
29
|
|
30
|
+
#include "utils.h"
|
31
|
+
#include "curve25519_donna_c64.h"
|
32
|
+
#include "../scalarmult_curve25519.h"
|
33
|
+
|
31
34
|
typedef uint8_t u8;
|
32
35
|
typedef uint64_t limb;
|
33
36
|
typedef limb felem[5];
|
@@ -35,11 +38,8 @@ typedef limb felem[5];
|
|
35
38
|
// platforms only as far as I know.
|
36
39
|
typedef unsigned uint128_t __attribute__((mode(TI)));
|
37
40
|
|
38
|
-
#undef force_inline
|
39
|
-
#define force_inline __attribute__((always_inline))
|
40
|
-
|
41
41
|
/* Sum two numbers: output += in */
|
42
|
-
static inline void
|
42
|
+
static inline void
|
43
43
|
fsum(limb *output, const limb *in) {
|
44
44
|
output[0] += in[0];
|
45
45
|
output[1] += in[1];
|
@@ -54,7 +54,7 @@ fsum(limb *output, const limb *in) {
|
|
54
54
|
* Assumes that out[i] < 2**52
|
55
55
|
* On return, out[i] < 2**55
|
56
56
|
*/
|
57
|
-
static inline void
|
57
|
+
static inline void
|
58
58
|
fdifference_backwards(felem out, const felem in) {
|
59
59
|
/* 152 is 19 << 3 */
|
60
60
|
static const limb two54m152 = (((limb)1) << 54) - 152;
|
@@ -68,7 +68,7 @@ fdifference_backwards(felem out, const felem in) {
|
|
68
68
|
}
|
69
69
|
|
70
70
|
/* Multiply a number by a scalar: output = in * scalar */
|
71
|
-
static inline void
|
71
|
+
static inline void
|
72
72
|
fscalar_product(felem output, const felem in, const limb scalar) {
|
73
73
|
uint128_t a;
|
74
74
|
|
@@ -98,7 +98,7 @@ fscalar_product(felem output, const felem in, const limb scalar) {
|
|
98
98
|
* Assumes that in[i] < 2**55 and likewise for in2.
|
99
99
|
* On return, output[i] < 2**52
|
100
100
|
*/
|
101
|
-
static inline void
|
101
|
+
static inline void
|
102
102
|
fmul(felem output, const felem in2, const felem in) {
|
103
103
|
uint128_t t[5];
|
104
104
|
limb r0,r1,r2,r3,r4,s0,s1,s2,s3,s4,c;
|
@@ -147,7 +147,7 @@ fmul(felem output, const felem in2, const felem in) {
|
|
147
147
|
output[4] = r4;
|
148
148
|
}
|
149
149
|
|
150
|
-
static inline void
|
150
|
+
static inline void
|
151
151
|
fsquare_times(felem output, const felem in, limb count) {
|
152
152
|
uint128_t t[5];
|
153
153
|
limb r0,r1,r2,r3,r4,c;
|
@@ -190,18 +190,18 @@ fsquare_times(felem output, const felem in, limb count) {
|
|
190
190
|
}
|
191
191
|
|
192
192
|
#ifdef NATIVE_LITTLE_ENDIAN
|
193
|
-
static inline limb
|
193
|
+
static inline limb
|
194
194
|
load_limb(const u8 *in) {
|
195
195
|
limb out;
|
196
196
|
memcpy(&out, in, sizeof (limb));
|
197
197
|
return out;
|
198
198
|
}
|
199
|
-
static inline void
|
199
|
+
static inline void
|
200
200
|
store_limb(u8 *out, limb in) {
|
201
201
|
memcpy(out, &in, sizeof (limb));
|
202
202
|
}
|
203
203
|
#else
|
204
|
-
static inline limb
|
204
|
+
static inline limb
|
205
205
|
load_limb(const u8 *in) {
|
206
206
|
return
|
207
207
|
((limb)in[0]) |
|
@@ -214,7 +214,7 @@ load_limb(const u8 *in) {
|
|
214
214
|
(((limb)in[7]) << 56);
|
215
215
|
}
|
216
216
|
|
217
|
-
static inline void
|
217
|
+
static inline void
|
218
218
|
store_limb(u8 *out, limb in) {
|
219
219
|
out[0] = in & 0xff;
|
220
220
|
out[1] = (in >> 8) & 0xff;
|
@@ -442,8 +442,12 @@ crecip(felem out, const felem z) {
|
|
442
442
|
/* 2^255 - 21 */ fmul(out, t0, a);
|
443
443
|
}
|
444
444
|
|
445
|
-
|
446
|
-
|
445
|
+
static const unsigned char basepoint[32] = {9};
|
446
|
+
|
447
|
+
static int
|
448
|
+
crypto_scalarmult_curve25519_donna_c64(unsigned char *mypublic,
|
449
|
+
const unsigned char *secret,
|
450
|
+
const unsigned char *basepoint) {
|
447
451
|
limb bp[5], x[5], z[5], zmone[5];
|
448
452
|
uint8_t e[32];
|
449
453
|
int i;
|
@@ -461,4 +465,17 @@ crypto_scalarmult(u8 *mypublic, const u8 *secret, const u8 *basepoint) {
|
|
461
465
|
return 0;
|
462
466
|
}
|
463
467
|
|
468
|
+
static int
|
469
|
+
crypto_scalarmult_curve25519_donna_c64_base(unsigned char *q,
|
470
|
+
const unsigned char *n)
|
471
|
+
{
|
472
|
+
return crypto_scalarmult_curve25519_donna_c64(q, n, basepoint);
|
473
|
+
}
|
474
|
+
|
475
|
+
struct crypto_scalarmult_curve25519_implementation
|
476
|
+
crypto_scalarmult_curve25519_donna_c64_implementation = {
|
477
|
+
SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_donna_c64,
|
478
|
+
SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_donna_c64_base
|
479
|
+
};
|
480
|
+
|
464
481
|
#endif
|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
#include <stddef.h>
|
3
|
+
|
4
|
+
#ifndef HAVE_TI_MODE
|
5
|
+
|
6
|
+
#include "utils.h"
|
7
|
+
#include "curve25519_ref10.h"
|
8
|
+
#include "../scalarmult_curve25519.h"
|
9
|
+
#include "fe.h"
|
10
|
+
|
11
|
+
static const unsigned char basepoint[32] = {9};
|
12
|
+
|
13
|
+
static int
|
14
|
+
crypto_scalarmult_curve25519_ref10(unsigned char *q,
|
15
|
+
const unsigned char *n,
|
16
|
+
const unsigned char *p)
|
17
|
+
{
|
18
|
+
unsigned char e[32];
|
19
|
+
unsigned int i;
|
20
|
+
fe x1;
|
21
|
+
fe x2;
|
22
|
+
fe z2;
|
23
|
+
fe x3;
|
24
|
+
fe z3;
|
25
|
+
fe tmp0;
|
26
|
+
fe tmp1;
|
27
|
+
int pos;
|
28
|
+
unsigned int swap;
|
29
|
+
unsigned int b;
|
30
|
+
|
31
|
+
for (i = 0;i < 32;++i) e[i] = n[i];
|
32
|
+
e[0] &= 248;
|
33
|
+
e[31] &= 127;
|
34
|
+
e[31] |= 64;
|
35
|
+
fe_frombytes(x1,p);
|
36
|
+
fe_1(x2);
|
37
|
+
fe_0(z2);
|
38
|
+
fe_copy(x3,x1);
|
39
|
+
fe_1(z3);
|
40
|
+
|
41
|
+
swap = 0;
|
42
|
+
for (pos = 254;pos >= 0;--pos) {
|
43
|
+
b = e[pos / 8] >> (pos & 7);
|
44
|
+
b &= 1;
|
45
|
+
swap ^= b;
|
46
|
+
fe_cswap(x2,x3,swap);
|
47
|
+
fe_cswap(z2,z3,swap);
|
48
|
+
swap = b;
|
49
|
+
#include "montgomery.h"
|
50
|
+
}
|
51
|
+
fe_cswap(x2,x3,swap);
|
52
|
+
fe_cswap(z2,z3,swap);
|
53
|
+
|
54
|
+
fe_invert(z2,z2);
|
55
|
+
fe_mul(x2,x2,z2);
|
56
|
+
fe_tobytes(q,x2);
|
57
|
+
return 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
static int
|
61
|
+
crypto_scalarmult_curve25519_ref10_base(unsigned char *q,
|
62
|
+
const unsigned char *n)
|
63
|
+
{
|
64
|
+
return crypto_scalarmult_curve25519_ref10(q,n,basepoint);
|
65
|
+
}
|
66
|
+
|
67
|
+
struct crypto_scalarmult_curve25519_implementation
|
68
|
+
crypto_scalarmult_curve25519_ref10_implementation = {
|
69
|
+
SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_ref10,
|
70
|
+
SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_ref10_base
|
71
|
+
};
|
72
|
+
|
73
|
+
#endif
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#ifdef IN_SANDY2X
|
2
|
+
|
3
|
+
/*
|
4
|
+
REDMASK51 is from amd64-51/consts.s.
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include "consts_namespace.h"
|
8
|
+
.data
|
9
|
+
.p2align 4
|
10
|
+
v0_0: .quad 0, 0
|
11
|
+
v1_0: .quad 1, 0
|
12
|
+
v2_1: .quad 2, 1
|
13
|
+
v9_0: .quad 9, 0
|
14
|
+
v9_9: .quad 9, 9
|
15
|
+
v19_19: .quad 19, 19
|
16
|
+
v38_1: .quad 38, 1
|
17
|
+
v38_38: .quad 38, 38
|
18
|
+
v121666_121666: .quad 121666, 121666
|
19
|
+
m25: .quad 33554431, 33554431
|
20
|
+
m26: .quad 67108863, 67108863
|
21
|
+
subc0: .quad 0x07FFFFDA, 0x03FFFFFE
|
22
|
+
subc2: .quad 0x07FFFFFE, 0x03FFFFFE
|
23
|
+
REDMASK51: .quad 0x0007FFFFFFFFFFFF
|
24
|
+
|
25
|
+
#endif
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#ifndef consts_namespace_H
|
2
|
+
#define consts_namespace_H
|
3
|
+
|
4
|
+
#define v0_0 crypto_scalarmult_curve25519_sandy2x_v0_0
|
5
|
+
#define v1_0 crypto_scalarmult_curve25519_sandy2x_v1_0
|
6
|
+
#define v2_1 crypto_scalarmult_curve25519_sandy2x_v2_1
|
7
|
+
#define v9_0 crypto_scalarmult_curve25519_sandy2x_v9_0
|
8
|
+
#define v9_9 crypto_scalarmult_curve25519_sandy2x_v9_9
|
9
|
+
#define v19_19 crypto_scalarmult_curve25519_sandy2x_v19_19
|
10
|
+
#define v38_1 crypto_scalarmult_curve25519_sandy2x_v38_1
|
11
|
+
#define v38_38 crypto_scalarmult_curve25519_sandy2x_v38_38
|
12
|
+
#define v121666_121666 crypto_scalarmult_curve25519_sandy2x_v121666_121666
|
13
|
+
#define m25 crypto_scalarmult_curve25519_sandy2x_m25
|
14
|
+
#define m26 crypto_scalarmult_curve25519_sandy2x_m26
|
15
|
+
#define subc0 crypto_scalarmult_curve25519_sandy2x_subc0
|
16
|
+
#define subc2 crypto_scalarmult_curve25519_sandy2x_subc2
|
17
|
+
#define REDMASK51 crypto_scalarmult_curve25519_sandy2x_REDMASK51
|
18
|
+
|
19
|
+
#endif //ifndef consts_namespace_H
|
20
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
/*
|
2
|
+
This file is adapted from ref10/scalarmult.c:
|
3
|
+
The code for Mongomery ladder is replace by the ladder assembly function;
|
4
|
+
Inversion is done in the same way as amd64-51/.
|
5
|
+
(fe is first converted into fe51 after Mongomery ladder)
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include <stddef.h>
|
9
|
+
|
10
|
+
#ifdef HAVE_AVX_ASM
|
11
|
+
|
12
|
+
#include "utils.h"
|
13
|
+
#include "curve25519_sandy2x.h"
|
14
|
+
#include "../scalarmult_curve25519.h"
|
15
|
+
#include "fe.h"
|
16
|
+
#include "fe51.h"
|
17
|
+
#include "ladder.h"
|
18
|
+
#include "ladder_base.h"
|
19
|
+
|
20
|
+
#define x1 var[0]
|
21
|
+
#define x2 var[1]
|
22
|
+
#define z2 var[2]
|
23
|
+
|
24
|
+
static int
|
25
|
+
crypto_scalarmult_curve25519_sandy2x(unsigned char *q, const unsigned char *n,
|
26
|
+
const unsigned char *p)
|
27
|
+
{
|
28
|
+
unsigned char e[32];
|
29
|
+
unsigned int i;
|
30
|
+
|
31
|
+
fe var[3];
|
32
|
+
|
33
|
+
fe51 x_51;
|
34
|
+
fe51 z_51;
|
35
|
+
|
36
|
+
for (i = 0;i < 32;++i) e[i] = n[i];
|
37
|
+
e[0] &= 248;
|
38
|
+
e[31] &= 127;
|
39
|
+
e[31] |= 64;
|
40
|
+
|
41
|
+
fe_frombytes(x1, p);
|
42
|
+
|
43
|
+
ladder(var, e);
|
44
|
+
|
45
|
+
z_51.v[0] = (z2[1] << 26) + z2[0];
|
46
|
+
z_51.v[1] = (z2[3] << 26) + z2[2];
|
47
|
+
z_51.v[2] = (z2[5] << 26) + z2[4];
|
48
|
+
z_51.v[3] = (z2[7] << 26) + z2[6];
|
49
|
+
z_51.v[4] = (z2[9] << 26) + z2[8];
|
50
|
+
|
51
|
+
x_51.v[0] = (x2[1] << 26) + x2[0];
|
52
|
+
x_51.v[1] = (x2[3] << 26) + x2[2];
|
53
|
+
x_51.v[2] = (x2[5] << 26) + x2[4];
|
54
|
+
x_51.v[3] = (x2[7] << 26) + x2[6];
|
55
|
+
x_51.v[4] = (x2[9] << 26) + x2[8];
|
56
|
+
|
57
|
+
fe51_invert(&z_51, &z_51);
|
58
|
+
fe51_mul(&x_51, &x_51, &z_51);
|
59
|
+
fe51_pack(q, &x_51);
|
60
|
+
|
61
|
+
return 0;
|
62
|
+
}
|
63
|
+
|
64
|
+
#undef x2
|
65
|
+
#undef z2
|
66
|
+
|
67
|
+
#define x2 var[0]
|
68
|
+
#define z2 var[1]
|
69
|
+
|
70
|
+
static int
|
71
|
+
crypto_scalarmult_curve25519_sandy2x_base(unsigned char *q,
|
72
|
+
const unsigned char *n)
|
73
|
+
{
|
74
|
+
unsigned char e[32];
|
75
|
+
unsigned int i;
|
76
|
+
|
77
|
+
fe var[3];
|
78
|
+
|
79
|
+
fe51 x_51;
|
80
|
+
fe51 z_51;
|
81
|
+
|
82
|
+
for (i = 0;i < 32;++i) e[i] = n[i];
|
83
|
+
e[0] &= 248;
|
84
|
+
e[31] &= 127;
|
85
|
+
e[31] |= 64;
|
86
|
+
|
87
|
+
ladder_base(var, e);
|
88
|
+
|
89
|
+
z_51.v[0] = (z2[1] << 26) + z2[0];
|
90
|
+
z_51.v[1] = (z2[3] << 26) + z2[2];
|
91
|
+
z_51.v[2] = (z2[5] << 26) + z2[4];
|
92
|
+
z_51.v[3] = (z2[7] << 26) + z2[6];
|
93
|
+
z_51.v[4] = (z2[9] << 26) + z2[8];
|
94
|
+
|
95
|
+
x_51.v[0] = (x2[1] << 26) + x2[0];
|
96
|
+
x_51.v[1] = (x2[3] << 26) + x2[2];
|
97
|
+
x_51.v[2] = (x2[5] << 26) + x2[4];
|
98
|
+
x_51.v[3] = (x2[7] << 26) + x2[6];
|
99
|
+
x_51.v[4] = (x2[9] << 26) + x2[8];
|
100
|
+
|
101
|
+
fe51_invert(&z_51, &z_51);
|
102
|
+
fe51_mul(&x_51, &x_51, &z_51);
|
103
|
+
fe51_pack(q, &x_51);
|
104
|
+
|
105
|
+
return 0;
|
106
|
+
}
|
107
|
+
|
108
|
+
struct crypto_scalarmult_curve25519_implementation
|
109
|
+
crypto_scalarmult_curve25519_sandy2x_implementation = {
|
110
|
+
SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_sandy2x,
|
111
|
+
SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_sandy2x_base
|
112
|
+
};
|
113
|
+
|
114
|
+
#endif
|