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,25 @@
|
|
1
|
+
/*
|
2
|
+
This file is adapted from ref10/fe.h:
|
3
|
+
All the redundant functions are removed.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#ifndef fe_H
|
7
|
+
#define fe_H
|
8
|
+
|
9
|
+
#include "crypto_uint64.h"
|
10
|
+
|
11
|
+
typedef crypto_uint64 fe[10];
|
12
|
+
|
13
|
+
/*
|
14
|
+
fe means field element.
|
15
|
+
Here the field is \Z/(2^255-19).
|
16
|
+
An element t, entries t[0]...t[9], represents the integer
|
17
|
+
t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
|
18
|
+
Bounds on each t[i] vary depending on context.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#define fe_frombytes crypto_scalarmult_curve25519_sandy2x_fe_frombytes
|
22
|
+
|
23
|
+
extern void fe_frombytes(fe, const unsigned char *);
|
24
|
+
|
25
|
+
#endif
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/*
|
2
|
+
This file is adapted from amd64-51/fe25519.h:
|
3
|
+
'fe25519' is renamed as 'fe51';
|
4
|
+
All the redundant functions are removed;
|
5
|
+
New function fe51_nsquare is introduced.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef fe51_H
|
9
|
+
#define fe51_H
|
10
|
+
|
11
|
+
#ifdef __cplusplus
|
12
|
+
extern "C" {
|
13
|
+
#endif
|
14
|
+
|
15
|
+
#include "crypto_uint64.h"
|
16
|
+
#include "fe51_namespace.h"
|
17
|
+
|
18
|
+
typedef struct
|
19
|
+
{
|
20
|
+
crypto_uint64 v[5];
|
21
|
+
}
|
22
|
+
fe51;
|
23
|
+
|
24
|
+
extern void fe51_pack(unsigned char *, const fe51 *);
|
25
|
+
extern void fe51_mul(fe51 *, const fe51 *, const fe51 *);
|
26
|
+
extern void fe51_nsquare(fe51 *, const fe51 *, int);
|
27
|
+
extern void fe51_invert(fe51 *, const fe51 *);
|
28
|
+
|
29
|
+
#ifdef __cplusplus
|
30
|
+
}
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#endif
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/*
|
2
|
+
This file is adapted from amd64-51/fe25519_invert.c:
|
3
|
+
Loops of squares are replaced by nsquares for better performance.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#include "fe51.h"
|
7
|
+
|
8
|
+
#ifdef HAVE_AVX_ASM
|
9
|
+
|
10
|
+
#define fe51_square(x, y) fe51_nsquare(x, y, 1)
|
11
|
+
|
12
|
+
void fe51_invert(fe51 *r, const fe51 *x)
|
13
|
+
{
|
14
|
+
fe51 z2;
|
15
|
+
fe51 z9;
|
16
|
+
fe51 z11;
|
17
|
+
fe51 z2_5_0;
|
18
|
+
fe51 z2_10_0;
|
19
|
+
fe51 z2_20_0;
|
20
|
+
fe51 z2_50_0;
|
21
|
+
fe51 z2_100_0;
|
22
|
+
fe51 t;
|
23
|
+
|
24
|
+
/* 2 */ fe51_square(&z2,x);
|
25
|
+
/* 4 */ fe51_square(&t,&z2);
|
26
|
+
/* 8 */ fe51_square(&t,&t);
|
27
|
+
/* 9 */ fe51_mul(&z9,&t,x);
|
28
|
+
/* 11 */ fe51_mul(&z11,&z9,&z2);
|
29
|
+
/* 22 */ fe51_square(&t,&z11);
|
30
|
+
/* 2^5 - 2^0 = 31 */ fe51_mul(&z2_5_0,&t,&z9);
|
31
|
+
|
32
|
+
/* 2^10 - 2^5 */ fe51_nsquare(&t,&z2_5_0, 5);
|
33
|
+
/* 2^10 - 2^0 */ fe51_mul(&z2_10_0,&t,&z2_5_0);
|
34
|
+
|
35
|
+
/* 2^20 - 2^10 */ fe51_nsquare(&t,&z2_10_0, 10);
|
36
|
+
/* 2^20 - 2^0 */ fe51_mul(&z2_20_0,&t,&z2_10_0);
|
37
|
+
|
38
|
+
/* 2^40 - 2^20 */ fe51_nsquare(&t,&z2_20_0, 20);
|
39
|
+
/* 2^40 - 2^0 */ fe51_mul(&t,&t,&z2_20_0);
|
40
|
+
|
41
|
+
/* 2^50 - 2^10 */ fe51_nsquare(&t,&t,10);
|
42
|
+
/* 2^50 - 2^0 */ fe51_mul(&z2_50_0,&t,&z2_10_0);
|
43
|
+
|
44
|
+
/* 2^100 - 2^50 */ fe51_nsquare(&t,&z2_50_0, 50);
|
45
|
+
/* 2^100 - 2^0 */ fe51_mul(&z2_100_0,&t,&z2_50_0);
|
46
|
+
|
47
|
+
/* 2^200 - 2^100 */ fe51_nsquare(&t,&z2_100_0, 100);
|
48
|
+
/* 2^200 - 2^0 */ fe51_mul(&t,&t,&z2_100_0);
|
49
|
+
|
50
|
+
/* 2^250 - 2^50 */ fe51_nsquare(&t,&t, 50);
|
51
|
+
/* 2^250 - 2^0 */ fe51_mul(&t,&t,&z2_50_0);
|
52
|
+
|
53
|
+
/* 2^255 - 2^5 */ fe51_nsquare(&t,&t,5);
|
54
|
+
/* 2^255 - 21 */ fe51_mul(r,&t,&z11);
|
55
|
+
}
|
56
|
+
|
57
|
+
#endif
|
@@ -0,0 +1,189 @@
|
|
1
|
+
#ifdef IN_SANDY2X
|
2
|
+
|
3
|
+
/*
|
4
|
+
This file is basically amd64-51/fe25519_mul.s.
|
5
|
+
*/
|
6
|
+
#include "fe51_namespace.h"
|
7
|
+
#include "consts_namespace.h"
|
8
|
+
.text
|
9
|
+
.p2align 5
|
10
|
+
.globl _fe51_mul
|
11
|
+
.globl fe51_mul
|
12
|
+
_fe51_mul:
|
13
|
+
fe51_mul:
|
14
|
+
mov %rsp,%r11
|
15
|
+
and $31,%r11
|
16
|
+
add $96,%r11
|
17
|
+
sub %r11,%rsp
|
18
|
+
movq %r11,0(%rsp)
|
19
|
+
movq %r12,8(%rsp)
|
20
|
+
movq %r13,16(%rsp)
|
21
|
+
movq %r14,24(%rsp)
|
22
|
+
movq %r15,32(%rsp)
|
23
|
+
movq %rbx,40(%rsp)
|
24
|
+
movq %rbp,48(%rsp)
|
25
|
+
movq %rdi,56(%rsp)
|
26
|
+
mov %rdx,%rcx
|
27
|
+
movq 24(%rsi),%rdx
|
28
|
+
imulq $19,%rdx,%rax
|
29
|
+
movq %rax,64(%rsp)
|
30
|
+
mulq 16(%rcx)
|
31
|
+
mov %rax,%r8
|
32
|
+
mov %rdx,%r9
|
33
|
+
movq 32(%rsi),%rdx
|
34
|
+
imulq $19,%rdx,%rax
|
35
|
+
movq %rax,72(%rsp)
|
36
|
+
mulq 8(%rcx)
|
37
|
+
add %rax,%r8
|
38
|
+
adc %rdx,%r9
|
39
|
+
movq 0(%rsi),%rax
|
40
|
+
mulq 0(%rcx)
|
41
|
+
add %rax,%r8
|
42
|
+
adc %rdx,%r9
|
43
|
+
movq 0(%rsi),%rax
|
44
|
+
mulq 8(%rcx)
|
45
|
+
mov %rax,%r10
|
46
|
+
mov %rdx,%r11
|
47
|
+
movq 0(%rsi),%rax
|
48
|
+
mulq 16(%rcx)
|
49
|
+
mov %rax,%r12
|
50
|
+
mov %rdx,%r13
|
51
|
+
movq 0(%rsi),%rax
|
52
|
+
mulq 24(%rcx)
|
53
|
+
mov %rax,%r14
|
54
|
+
mov %rdx,%r15
|
55
|
+
movq 0(%rsi),%rax
|
56
|
+
mulq 32(%rcx)
|
57
|
+
mov %rax,%rbx
|
58
|
+
mov %rdx,%rbp
|
59
|
+
movq 8(%rsi),%rax
|
60
|
+
mulq 0(%rcx)
|
61
|
+
add %rax,%r10
|
62
|
+
adc %rdx,%r11
|
63
|
+
movq 8(%rsi),%rax
|
64
|
+
mulq 8(%rcx)
|
65
|
+
add %rax,%r12
|
66
|
+
adc %rdx,%r13
|
67
|
+
movq 8(%rsi),%rax
|
68
|
+
mulq 16(%rcx)
|
69
|
+
add %rax,%r14
|
70
|
+
adc %rdx,%r15
|
71
|
+
movq 8(%rsi),%rax
|
72
|
+
mulq 24(%rcx)
|
73
|
+
add %rax,%rbx
|
74
|
+
adc %rdx,%rbp
|
75
|
+
movq 8(%rsi),%rdx
|
76
|
+
imulq $19,%rdx,%rax
|
77
|
+
mulq 32(%rcx)
|
78
|
+
add %rax,%r8
|
79
|
+
adc %rdx,%r9
|
80
|
+
movq 16(%rsi),%rax
|
81
|
+
mulq 0(%rcx)
|
82
|
+
add %rax,%r12
|
83
|
+
adc %rdx,%r13
|
84
|
+
movq 16(%rsi),%rax
|
85
|
+
mulq 8(%rcx)
|
86
|
+
add %rax,%r14
|
87
|
+
adc %rdx,%r15
|
88
|
+
movq 16(%rsi),%rax
|
89
|
+
mulq 16(%rcx)
|
90
|
+
add %rax,%rbx
|
91
|
+
adc %rdx,%rbp
|
92
|
+
movq 16(%rsi),%rdx
|
93
|
+
imulq $19,%rdx,%rax
|
94
|
+
mulq 24(%rcx)
|
95
|
+
add %rax,%r8
|
96
|
+
adc %rdx,%r9
|
97
|
+
movq 16(%rsi),%rdx
|
98
|
+
imulq $19,%rdx,%rax
|
99
|
+
mulq 32(%rcx)
|
100
|
+
add %rax,%r10
|
101
|
+
adc %rdx,%r11
|
102
|
+
movq 24(%rsi),%rax
|
103
|
+
mulq 0(%rcx)
|
104
|
+
add %rax,%r14
|
105
|
+
adc %rdx,%r15
|
106
|
+
movq 24(%rsi),%rax
|
107
|
+
mulq 8(%rcx)
|
108
|
+
add %rax,%rbx
|
109
|
+
adc %rdx,%rbp
|
110
|
+
movq 64(%rsp),%rax
|
111
|
+
mulq 24(%rcx)
|
112
|
+
add %rax,%r10
|
113
|
+
adc %rdx,%r11
|
114
|
+
movq 64(%rsp),%rax
|
115
|
+
mulq 32(%rcx)
|
116
|
+
add %rax,%r12
|
117
|
+
adc %rdx,%r13
|
118
|
+
movq 32(%rsi),%rax
|
119
|
+
mulq 0(%rcx)
|
120
|
+
add %rax,%rbx
|
121
|
+
adc %rdx,%rbp
|
122
|
+
movq 72(%rsp),%rax
|
123
|
+
mulq 16(%rcx)
|
124
|
+
add %rax,%r10
|
125
|
+
adc %rdx,%r11
|
126
|
+
movq 72(%rsp),%rax
|
127
|
+
mulq 24(%rcx)
|
128
|
+
add %rax,%r12
|
129
|
+
adc %rdx,%r13
|
130
|
+
movq 72(%rsp),%rax
|
131
|
+
mulq 32(%rcx)
|
132
|
+
add %rax,%r14
|
133
|
+
adc %rdx,%r15
|
134
|
+
movq REDMASK51(%rip),%rsi
|
135
|
+
shld $13,%r8,%r9
|
136
|
+
and %rsi,%r8
|
137
|
+
shld $13,%r10,%r11
|
138
|
+
and %rsi,%r10
|
139
|
+
add %r9,%r10
|
140
|
+
shld $13,%r12,%r13
|
141
|
+
and %rsi,%r12
|
142
|
+
add %r11,%r12
|
143
|
+
shld $13,%r14,%r15
|
144
|
+
and %rsi,%r14
|
145
|
+
add %r13,%r14
|
146
|
+
shld $13,%rbx,%rbp
|
147
|
+
and %rsi,%rbx
|
148
|
+
add %r15,%rbx
|
149
|
+
imulq $19,%rbp,%rdx
|
150
|
+
add %rdx,%r8
|
151
|
+
mov %r8,%rdx
|
152
|
+
shr $51,%rdx
|
153
|
+
add %r10,%rdx
|
154
|
+
mov %rdx,%rcx
|
155
|
+
shr $51,%rdx
|
156
|
+
and %rsi,%r8
|
157
|
+
add %r12,%rdx
|
158
|
+
mov %rdx,%r9
|
159
|
+
shr $51,%rdx
|
160
|
+
and %rsi,%rcx
|
161
|
+
add %r14,%rdx
|
162
|
+
mov %rdx,%rax
|
163
|
+
shr $51,%rdx
|
164
|
+
and %rsi,%r9
|
165
|
+
add %rbx,%rdx
|
166
|
+
mov %rdx,%r10
|
167
|
+
shr $51,%rdx
|
168
|
+
and %rsi,%rax
|
169
|
+
imulq $19,%rdx,%rdx
|
170
|
+
add %rdx,%r8
|
171
|
+
and %rsi,%r10
|
172
|
+
movq %r8,0(%rdi)
|
173
|
+
movq %rcx,8(%rdi)
|
174
|
+
movq %r9,16(%rdi)
|
175
|
+
movq %rax,24(%rdi)
|
176
|
+
movq %r10,32(%rdi)
|
177
|
+
movq 0(%rsp),%r11
|
178
|
+
movq 8(%rsp),%r12
|
179
|
+
movq 16(%rsp),%r13
|
180
|
+
movq 24(%rsp),%r14
|
181
|
+
movq 32(%rsp),%r15
|
182
|
+
movq 40(%rsp),%rbx
|
183
|
+
movq 48(%rsp),%rbp
|
184
|
+
add %r11,%rsp
|
185
|
+
mov %rdi,%rax
|
186
|
+
mov %rsi,%rdx
|
187
|
+
ret
|
188
|
+
|
189
|
+
#endif
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#ifndef fe51_namespace_H
|
2
|
+
#define fe51_namespace_H
|
3
|
+
|
4
|
+
#define fe51 crypto_scalarmult_curve25519_sandy2x_fe51
|
5
|
+
#define _fe51 _crypto_scalarmult_curve25519_sandy2x_fe51
|
6
|
+
#define fe51_pack crypto_scalarmult_curve25519_sandy2x_fe51_pack
|
7
|
+
#define _fe51_pack _crypto_scalarmult_curve25519_sandy2x_fe51_pack
|
8
|
+
#define fe51_mul crypto_scalarmult_curve25519_sandy2x_fe51_mul
|
9
|
+
#define _fe51_mul _crypto_scalarmult_curve25519_sandy2x_fe51_mul
|
10
|
+
#define fe51_nsquare crypto_scalarmult_curve25519_sandy2x_fe51_nsquare
|
11
|
+
#define _fe51_nsquare _crypto_scalarmult_curve25519_sandy2x_fe51_nsquare
|
12
|
+
|
13
|
+
#define fe51_invert crypto_scalarmult_curve25519_sandy2x_fe51_invert
|
14
|
+
|
15
|
+
#endif //ifndef fe51_namespace_H
|
16
|
+
|
@@ -0,0 +1,165 @@
|
|
1
|
+
#ifdef IN_SANDY2X
|
2
|
+
|
3
|
+
/*
|
4
|
+
This file is adapted from amd64-51/fe25519_square.s:
|
5
|
+
Adding loop to perform n squares.
|
6
|
+
*/
|
7
|
+
#include "fe51_namespace.h"
|
8
|
+
#include "consts_namespace.h"
|
9
|
+
.p2align 5
|
10
|
+
|
11
|
+
.globl fe51_nsquare
|
12
|
+
.globl _fe51_nsquare
|
13
|
+
#ifdef __ELF__
|
14
|
+
.type fe51_nsquare, @function
|
15
|
+
.type _fe51_nsquare, @function
|
16
|
+
#endif
|
17
|
+
fe51_nsquare:
|
18
|
+
_fe51_nsquare:
|
19
|
+
|
20
|
+
mov %rsp,%r11
|
21
|
+
and $31,%r11
|
22
|
+
add $64,%r11
|
23
|
+
sub %r11,%rsp
|
24
|
+
movq %r11,0(%rsp)
|
25
|
+
movq %r12,8(%rsp)
|
26
|
+
movq %r13,16(%rsp)
|
27
|
+
movq %r14,24(%rsp)
|
28
|
+
movq %r15,32(%rsp)
|
29
|
+
movq %rbx,40(%rsp)
|
30
|
+
movq %rbp,48(%rsp)
|
31
|
+
movq 0(%rsi),%rcx
|
32
|
+
movq 8(%rsi),%r8
|
33
|
+
movq 16(%rsi),%r9
|
34
|
+
movq 24(%rsi),%rax
|
35
|
+
movq 32(%rsi),%rsi
|
36
|
+
movq %r9,16(%rdi)
|
37
|
+
movq %rax,24(%rdi)
|
38
|
+
movq %rsi,32(%rdi)
|
39
|
+
mov %rdx,%rsi
|
40
|
+
._loop:
|
41
|
+
sub $1,%rsi
|
42
|
+
mov %rcx,%rax
|
43
|
+
mul %rcx
|
44
|
+
add %rcx,%rcx
|
45
|
+
mov %rax,%r9
|
46
|
+
mov %rdx,%r10
|
47
|
+
mov %rcx,%rax
|
48
|
+
mul %r8
|
49
|
+
mov %rax,%r11
|
50
|
+
mov %rdx,%r12
|
51
|
+
mov %rcx,%rax
|
52
|
+
mulq 16(%rdi)
|
53
|
+
mov %rax,%r13
|
54
|
+
mov %rdx,%r14
|
55
|
+
mov %rcx,%rax
|
56
|
+
mulq 24(%rdi)
|
57
|
+
mov %rax,%r15
|
58
|
+
mov %rdx,%rbx
|
59
|
+
mov %rcx,%rax
|
60
|
+
mulq 32(%rdi)
|
61
|
+
mov %rax,%rcx
|
62
|
+
mov %rdx,%rbp
|
63
|
+
mov %r8,%rax
|
64
|
+
mul %r8
|
65
|
+
add %r8,%r8
|
66
|
+
add %rax,%r13
|
67
|
+
adc %rdx,%r14
|
68
|
+
mov %r8,%rax
|
69
|
+
mulq 16(%rdi)
|
70
|
+
add %rax,%r15
|
71
|
+
adc %rdx,%rbx
|
72
|
+
mov %r8,%rax
|
73
|
+
imulq $19, %r8,%r8
|
74
|
+
mulq 24(%rdi)
|
75
|
+
add %rax,%rcx
|
76
|
+
adc %rdx,%rbp
|
77
|
+
mov %r8,%rax
|
78
|
+
mulq 32(%rdi)
|
79
|
+
add %rax,%r9
|
80
|
+
adc %rdx,%r10
|
81
|
+
movq 16(%rdi),%rax
|
82
|
+
mulq 16(%rdi)
|
83
|
+
add %rax,%rcx
|
84
|
+
adc %rdx,%rbp
|
85
|
+
shld $13,%rcx,%rbp
|
86
|
+
movq 16(%rdi),%rax
|
87
|
+
imulq $38, %rax,%rax
|
88
|
+
mulq 24(%rdi)
|
89
|
+
add %rax,%r9
|
90
|
+
adc %rdx,%r10
|
91
|
+
shld $13,%r9,%r10
|
92
|
+
movq 16(%rdi),%rax
|
93
|
+
imulq $38, %rax,%rax
|
94
|
+
mulq 32(%rdi)
|
95
|
+
add %rax,%r11
|
96
|
+
adc %rdx,%r12
|
97
|
+
movq 24(%rdi),%rax
|
98
|
+
imulq $19, %rax,%rax
|
99
|
+
mulq 24(%rdi)
|
100
|
+
add %rax,%r11
|
101
|
+
adc %rdx,%r12
|
102
|
+
shld $13,%r11,%r12
|
103
|
+
movq 24(%rdi),%rax
|
104
|
+
imulq $38, %rax,%rax
|
105
|
+
mulq 32(%rdi)
|
106
|
+
add %rax,%r13
|
107
|
+
adc %rdx,%r14
|
108
|
+
shld $13,%r13,%r14
|
109
|
+
movq 32(%rdi),%rax
|
110
|
+
imulq $19, %rax,%rax
|
111
|
+
mulq 32(%rdi)
|
112
|
+
add %rax,%r15
|
113
|
+
adc %rdx,%rbx
|
114
|
+
shld $13,%r15,%rbx
|
115
|
+
movq REDMASK51(%rip),%rdx
|
116
|
+
and %rdx,%rcx
|
117
|
+
add %rbx,%rcx
|
118
|
+
and %rdx,%r9
|
119
|
+
and %rdx,%r11
|
120
|
+
add %r10,%r11
|
121
|
+
and %rdx,%r13
|
122
|
+
add %r12,%r13
|
123
|
+
and %rdx,%r15
|
124
|
+
add %r14,%r15
|
125
|
+
imulq $19, %rbp,%rbp
|
126
|
+
lea (%r9,%rbp),%r9
|
127
|
+
mov %r9,%rax
|
128
|
+
shr $51,%r9
|
129
|
+
add %r11,%r9
|
130
|
+
and %rdx,%rax
|
131
|
+
mov %r9,%r8
|
132
|
+
shr $51,%r9
|
133
|
+
add %r13,%r9
|
134
|
+
and %rdx,%r8
|
135
|
+
mov %r9,%r10
|
136
|
+
shr $51,%r9
|
137
|
+
add %r15,%r9
|
138
|
+
and %rdx,%r10
|
139
|
+
movq %r10,16(%rdi)
|
140
|
+
mov %r9,%r10
|
141
|
+
shr $51,%r9
|
142
|
+
add %rcx,%r9
|
143
|
+
and %rdx,%r10
|
144
|
+
movq %r10,24(%rdi)
|
145
|
+
mov %r9,%r10
|
146
|
+
shr $51,%r9
|
147
|
+
imulq $19, %r9,%r9
|
148
|
+
lea (%rax,%r9),%rcx
|
149
|
+
and %rdx,%r10
|
150
|
+
movq %r10,32(%rdi)
|
151
|
+
cmp $0,%rsi
|
152
|
+
jne ._loop
|
153
|
+
movq %rcx,0(%rdi)
|
154
|
+
movq %r8,8(%rdi)
|
155
|
+
movq 0(%rsp),%r11
|
156
|
+
movq 8(%rsp),%r12
|
157
|
+
movq 16(%rsp),%r13
|
158
|
+
movq 24(%rsp),%r14
|
159
|
+
movq 32(%rsp),%r15
|
160
|
+
movq 40(%rsp),%rbx
|
161
|
+
movq 48(%rsp),%rbp
|
162
|
+
add %r11,%rsp
|
163
|
+
ret
|
164
|
+
|
165
|
+
#endif
|