rbnacl-libsodium 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/vendor/libsodium/AUTHORS +14 -9
- data/vendor/libsodium/ChangeLog +26 -0
- data/vendor/libsodium/LICENSE +1 -1
- data/vendor/libsodium/Makefile.am +1 -0
- data/vendor/libsodium/README.markdown +185 -46
- data/vendor/libsodium/THANKS +10 -0
- data/vendor/libsodium/builds/msvc/properties/Common.props +21 -0
- data/vendor/libsodium/builds/msvc/properties/DLL.props +16 -0
- data/vendor/libsodium/builds/msvc/properties/Debug.props +29 -0
- data/vendor/libsodium/builds/msvc/properties/DebugDEXE.props +21 -0
- data/vendor/libsodium/builds/msvc/properties/DebugDLL.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/DebugLEXE.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/DebugLIB.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/DebugLTCG.props +19 -0
- data/vendor/libsodium/builds/msvc/properties/DebugSEXE.props +21 -0
- data/vendor/libsodium/builds/msvc/properties/EXE.props +17 -0
- data/vendor/libsodium/builds/msvc/properties/LIB.props +16 -0
- data/vendor/libsodium/builds/msvc/properties/LTCG.props +13 -0
- data/vendor/libsodium/builds/msvc/properties/Link.props +21 -0
- data/vendor/libsodium/builds/msvc/properties/Messages.props +15 -0
- data/vendor/libsodium/builds/msvc/properties/Output.props +30 -0
- data/vendor/libsodium/builds/msvc/properties/Release.props +41 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseDEXE.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseDLL.props +19 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseLEXE.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseLIB.props +19 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseLTCG.props +19 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseSEXE.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/Win32.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/x64.props +23 -0
- data/vendor/libsodium/builds/msvc/resource.h +0 -0
- data/vendor/libsodium/builds/msvc/resource.rc +0 -0
- data/vendor/libsodium/builds/msvc/version.h +29 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium.import.props +52 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium.import.xml +17 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium.sln +79 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.props +43 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +345 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +1037 -0
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.xml +15 -0
- data/vendor/libsodium/builds/msvc/vs2010/test/test.props +37 -0
- data/vendor/libsodium/builds/msvc/vs2010/test/test.runner.bat +78 -0
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj +220 -0
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj.filters +168 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium.import.props +52 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium.import.xml +17 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium.sln +79 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.props +43 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +345 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +1037 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.xml +15 -0
- data/vendor/libsodium/builds/msvc/vs2012/test/test.props +37 -0
- data/vendor/libsodium/builds/msvc/vs2012/test/test.runner.bat +78 -0
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj +220 -0
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj.filters +168 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium.import.props +52 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium.import.xml +17 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium.sln +81 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.props +43 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +345 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +1037 -0
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.xml +15 -0
- data/vendor/libsodium/builds/msvc/vs2013/test/test.props +37 -0
- data/vendor/libsodium/builds/msvc/vs2013/test/test.runner.bat +78 -0
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj +220 -0
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj.filters +168 -0
- data/vendor/libsodium/configure.ac +87 -68
- data/vendor/libsodium/dist-build/Makefile.am +10 -0
- data/vendor/libsodium/dist-build/android-arm.sh +3 -0
- data/vendor/libsodium/dist-build/android-armv7.sh +3 -0
- data/vendor/libsodium/dist-build/android-build.sh +37 -0
- data/vendor/libsodium/dist-build/android-mips.sh +3 -0
- data/vendor/libsodium/dist-build/android-x86.sh +3 -0
- data/vendor/libsodium/dist-build/emscripten.sh +13 -0
- data/vendor/libsodium/dist-build/{iphone.sh → ios.sh} +2 -2
- data/vendor/libsodium/dist-build/msys2-win32.sh +10 -0
- data/vendor/libsodium/dist-build/msys2-win64.sh +10 -0
- data/vendor/libsodium/libsodium.vcxproj +25 -13
- data/vendor/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/msvc-scripts/process.bat +3 -7
- data/vendor/libsodium/packaging/nuget/package.bat +13 -0
- data/vendor/libsodium/packaging/nuget/package.config +4 -0
- data/vendor/libsodium/packaging/nuget/package.gsl +255 -0
- data/vendor/libsodium/packaging/nuget/package.nuspec +93 -0
- data/vendor/libsodium/packaging/nuget/package.targets +128 -0
- data/vendor/libsodium/packaging/nuget/package.xml +22 -0
- data/vendor/libsodium/src/libsodium/Makefile.am +32 -20
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/{ref → cp}/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +110 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/{ref → cp}/verify_hmacsha256.c +0 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512_api.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/api.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +110 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c +10 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/{ref → cp}/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c +54 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/{ref → cp}/verify_hmacsha512256.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +94 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/core_salsa20_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/core_salsa2012_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/core_salsa208_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c +15 -5
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/api.h +0 -2
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +14 -6
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +95 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +50 -3
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +4 -10
- data/vendor/libsodium/src/libsodium/crypto_hash/crypto_hash.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/{ref → cp}/api.h +3 -1
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +294 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/{ref → cp}/api.h +3 -1
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +321 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c +51 -127
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +12 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +221 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +209 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c +1 -140
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c +250 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt.h +100 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/nosse/pwhash_scryptxsalsa208sha256_nosse.c +302 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/pbkdf2-sha256.c +94 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/pbkdf2-sha256.h +45 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/pwhash_scryptxsalsa208sha256.c +172 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/scrypt_platform.c +96 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/sse/pwhash_scryptxsalsa208sha256_sse.c +391 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/sysendian.h +146 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/api.h +2 -2
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/smult_curve25519_donna_c64.c +39 -9
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/api.h +2 -2
- data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +6 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +94 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24_api.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_scalarmult_base.c +6 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +5 -3
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +28 -18
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +14 -9
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +21 -21
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128.h +6 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +42 -42
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-be.h +4 -4
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-le.h +4 -4
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c +15 -14
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/stream_aes256estream_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +153 -160
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/api.h +2 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +9 -3
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +9 -3
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/api.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20_api.c +0 -5
- data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/api.h +2 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/verify_64.c +72 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/64/verify_64_api.c +6 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.am +6 -7
- data/vendor/libsodium/src/libsodium/include/sodium.h +4 -3
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +31 -9
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +58 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +26 -9
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +13 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +38 -24
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h +6 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h +6 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h +6 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h +6 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash.h +7 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +36 -16
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash.h +13 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +25 -7
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h +25 -7
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +5 -5
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptxsalsa208sha256.h +48 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +31 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +17 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +21 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +8 -7
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +16 -17
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +18 -14
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +18 -18
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes256estream.h +19 -18
- data/vendor/libsodium/src/libsodium/include/sodium/{crypto_stream_salsa20.h.in → crypto_stream_salsa20.h} +8 -19
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +8 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +8 -8
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +10 -11
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_16.h +1 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_32.h +1 -4
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_64.h +22 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +27 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +15 -3
- data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +3 -1
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +18 -7
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +57 -9
- data/vendor/libsodium/src/libsodium/sodium/compat.c +62 -0
- data/vendor/libsodium/src/libsodium/sodium/core.c +2 -0
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +134 -0
- data/vendor/libsodium/src/libsodium/sodium/utils.c +100 -8
- data/vendor/libsodium/test/default/Makefile.am +63 -3
- data/vendor/libsodium/test/default/auth6.c +21 -0
- data/vendor/libsodium/test/default/auth6.exp +8 -0
- data/vendor/libsodium/test/default/auth7.c +37 -0
- data/vendor/libsodium/test/default/auth7.exp +0 -0
- data/vendor/libsodium/test/default/box_easy.c +59 -0
- data/vendor/libsodium/test/default/box_easy.exp +19 -0
- data/vendor/libsodium/test/default/box_easy2.c +31 -0
- data/vendor/libsodium/test/default/box_easy2.exp +1 -0
- data/vendor/libsodium/test/default/cmptest.h +7 -1
- data/vendor/libsodium/test/default/generichash3.c +36 -0
- data/vendor/libsodium/test/default/generichash3.exp +64 -0
- data/vendor/libsodium/test/default/pwhash.c +59 -0
- data/vendor/libsodium/test/default/pwhash.exp +2 -0
- data/vendor/libsodium/test/default/scalarmult7.c +0 -2
- data/vendor/libsodium/test/default/scalarmult8.c +0 -2
- data/vendor/libsodium/test/default/secretbox_easy.c +51 -0
- data/vendor/libsodium/test/default/secretbox_easy.exp +19 -0
- data/vendor/libsodium/test/default/secretbox_easy2.c +27 -0
- data/vendor/libsodium/test/default/secretbox_easy2.exp +1 -0
- data/vendor/libsodium/test/default/sign.c +1106 -0
- data/vendor/libsodium/test/default/sign.exp +3 -0
- data/vendor/libsodium/test/default/sodium_utils.c +8 -0
- data/vendor/libsodium/test/default/sodium_utils.exp +2 -1
- data/vendor/libsodium/test/default/sodium_version.c +1 -1
- data/vendor/libsodium/test/default/verify1.c +34 -0
- data/vendor/libsodium/test/default/verify1.exp +6 -0
- metadata +138 -33
- data/vendor/libsodium/dist-build/android.sh +0 -48
- data/vendor/libsodium/dist-build/msys.sh +0 -9
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/hmac_hmacsha256.c +0 -83
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/hmac_hmacsha512256.c +0 -86
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/ref/hash_sha256.c +0 -69
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/ref/hash_sha512.c +0 -71
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/checksum +0 -1
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/hashblocks_sha256_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/blocks_sha256.c +0 -212
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/checksum +0 -1
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/hashblocks_sha512_api.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/api.h +0 -9
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/blocks_sha512.c +0 -239
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/try.c +0 -78
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/api.h +0 -8
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/auth_poly1305_53.c +0 -1661
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/verify_poly1305_53.c +0 -10
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/portable-jane.h +0 -772
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha256.h +0 -32
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha512.h +0 -32
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_53.h +0 -34
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h.in +0 -44
@@ -1,10 +0,0 @@
|
|
1
|
-
#include "api.h"
|
2
|
-
#include "crypto_onetimeauth_poly1305_53.h"
|
3
|
-
#include "crypto_verify_16.h"
|
4
|
-
|
5
|
-
int crypto_onetimeauth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k)
|
6
|
-
{
|
7
|
-
unsigned char correct[16];
|
8
|
-
crypto_onetimeauth(correct,in,inlen,k);
|
9
|
-
return crypto_verify_16(h,correct);
|
10
|
-
}
|
@@ -1,772 +0,0 @@
|
|
1
|
-
#ifndef PORTABLE_JANE_H
|
2
|
-
#define PORTABLE_JANE_H "+endian +uint128"
|
3
|
-
/* 0000-os-100-solaris.h */
|
4
|
-
|
5
|
-
#if defined(sun) || defined(__sun) || defined(__SVR4) || defined(__svr4__)
|
6
|
-
#include <sys/mman.h>
|
7
|
-
#include <sys/time.h>
|
8
|
-
#include <fcntl.h>
|
9
|
-
|
10
|
-
#define OS_SOLARIS
|
11
|
-
#endif
|
12
|
-
|
13
|
-
/* 0000-os-100-unix.h */
|
14
|
-
|
15
|
-
#if defined(__unix__) || defined(unix)
|
16
|
-
#include <sys/mman.h>
|
17
|
-
#include <sys/time.h>
|
18
|
-
#if !defined(USG)
|
19
|
-
#include <sys/param.h> /* need this to define BSD */
|
20
|
-
#endif
|
21
|
-
#include <unistd.h>
|
22
|
-
#include <fcntl.h>
|
23
|
-
|
24
|
-
#define OS_NIX
|
25
|
-
#if defined(__linux__)
|
26
|
-
#include <endian.h>
|
27
|
-
#define OS_LINUX
|
28
|
-
#elif defined(BSD)
|
29
|
-
#define OS_BSD
|
30
|
-
|
31
|
-
#if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__))
|
32
|
-
#define OS_OSX
|
33
|
-
#elif defined(macintosh) || defined(Macintosh)
|
34
|
-
#define OS_MAC
|
35
|
-
#elif defined(__OpenBSD__)
|
36
|
-
#define OS_OPENBSD
|
37
|
-
#elif defined(__FreeBSD__)
|
38
|
-
#define OS_FREEBSD
|
39
|
-
#elif defined(__NetBSD__)
|
40
|
-
#define OS_NETBSD
|
41
|
-
#endif
|
42
|
-
#endif
|
43
|
-
#endif
|
44
|
-
|
45
|
-
/* 0000-os-100-windows.h */
|
46
|
-
|
47
|
-
#if defined(_WIN32) || defined(_WIN64) || defined(__TOS_WIN__) || defined(__WINDOWS__)
|
48
|
-
#include <windows.h>
|
49
|
-
#include <wincrypt.h>
|
50
|
-
#define OS_WINDOWS
|
51
|
-
#endif
|
52
|
-
|
53
|
-
/* 0100-compiler-000.h */
|
54
|
-
|
55
|
-
#undef NOINLINE
|
56
|
-
#undef INLINE
|
57
|
-
#undef FASTCALL
|
58
|
-
#undef CDECL
|
59
|
-
#undef STDCALL
|
60
|
-
#undef NAKED
|
61
|
-
|
62
|
-
/* 0100-compiler-100-clang.h */
|
63
|
-
|
64
|
-
#if defined(__clang__)
|
65
|
-
#define COMPILER_CLANG ((__clang_major__ * 10000) + (__clang_minor__ * 100) + (__clang_patchlevel__))
|
66
|
-
#endif
|
67
|
-
|
68
|
-
/* 0100-compiler-100-gcc.h */
|
69
|
-
|
70
|
-
#if defined(__GNUC__)
|
71
|
-
#if (__GNUC__ >= 3)
|
72
|
-
#define COMPILER_GCC_PATCHLEVEL __GNUC_PATCHLEVEL__
|
73
|
-
#else
|
74
|
-
#define COMPILER_GCC_PATCHLEVEL 0
|
75
|
-
#endif
|
76
|
-
#define COMPILER_GCC ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + (COMPILER_GCC_PATCHLEVEL))
|
77
|
-
|
78
|
-
#include <stdint.h>
|
79
|
-
|
80
|
-
typedef unsigned int fpu_control_t;
|
81
|
-
|
82
|
-
#define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b)))
|
83
|
-
#define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b)))
|
84
|
-
#define ROTL64(a,b) (((a) << (b)) | ((a) >> (64 - b)))
|
85
|
-
#define ROTR64(a,b) (((a) >> (b)) | ((a) << (64 - b)))
|
86
|
-
|
87
|
-
#if (COMPILER_GCC >= 30000)
|
88
|
-
#define NOINLINE __attribute__((noinline))
|
89
|
-
#else
|
90
|
-
#define NOINLINE
|
91
|
-
#endif
|
92
|
-
#if (COMPILER_GCC >= 30000)
|
93
|
-
#define INLINE inline __attribute__((always_inline))
|
94
|
-
#else
|
95
|
-
#define INLINE inline
|
96
|
-
#endif
|
97
|
-
#if (COMPILER_GCC >= 30400)
|
98
|
-
#define FASTCALL __attribute__((fastcall))
|
99
|
-
#else
|
100
|
-
#define FASTCALL
|
101
|
-
#endif
|
102
|
-
#define CDECL __attribute__((cdecl))
|
103
|
-
#define STDCALL __attribute__((stdcall))
|
104
|
-
|
105
|
-
#define mul32x32_64(a,b) ((uint64_t)(a) * (b))
|
106
|
-
#define mul32x32_64s(a,b) (((int64_t)(a))*(b))
|
107
|
-
#endif
|
108
|
-
|
109
|
-
/* 0100-compiler-100-icc.h */
|
110
|
-
|
111
|
-
#if defined(__ICC)
|
112
|
-
#define COMPILER_ICC __ICC
|
113
|
-
#endif
|
114
|
-
|
115
|
-
/* 0100-compiler-100-mingw.h */
|
116
|
-
|
117
|
-
#if defined(__MINGW32__) || defined(__MINGW64__)
|
118
|
-
#define COMPILER_MINGW
|
119
|
-
#endif
|
120
|
-
|
121
|
-
/* 0100-compiler-100-msvc.h */
|
122
|
-
|
123
|
-
#if defined(_MSC_VER)
|
124
|
-
#ifndef _CRT_SECURE_NO_WARNINGS
|
125
|
-
# define _CRT_SECURE_NO_WARNINGS
|
126
|
-
#endif
|
127
|
-
|
128
|
-
#pragma warning(disable : 4127) /* conditional expression is constant */
|
129
|
-
#pragma warning(disable : 4100) /* unreferenced formal parameter */
|
130
|
-
|
131
|
-
#include <float.h>
|
132
|
-
#include <stdlib.h> /* _rotl */
|
133
|
-
#include <intrin.h>
|
134
|
-
|
135
|
-
#define COMPILER_MSVC_VS6 120000000
|
136
|
-
#define COMPILER_MSVC_VS6PP 121000000
|
137
|
-
#define COMPILER_MSVC_VS2002 130000000
|
138
|
-
#define COMPILER_MSVC_VS2003 131000000
|
139
|
-
#define COMPILER_MSVC_VS2005 140050727
|
140
|
-
#define COMPILER_MSVC_VS2008 150000000
|
141
|
-
#define COMPILER_MSVC_VS2008SP1 150030729
|
142
|
-
#define COMPILER_MSVC_VS2010 160000000
|
143
|
-
#define COMPILER_MSVC_VS2010SP1 160040219
|
144
|
-
#define COMPILER_MSVC_VS2012RC 170000000
|
145
|
-
#define COMPILER_MSVC_VS2012 170050727
|
146
|
-
|
147
|
-
#if _MSC_FULL_VER > 100000000
|
148
|
-
#define COMPILER_MSVC (_MSC_FULL_VER)
|
149
|
-
#else
|
150
|
-
#define COMPILER_MSVC (_MSC_FULL_VER * 10)
|
151
|
-
#endif
|
152
|
-
|
153
|
-
#if ((_MSC_VER == 1200) && defined(_mm_free))
|
154
|
-
#undef COMPILER_MSVC
|
155
|
-
#define COMPILER_MSVC COMPILER_MSVC_VS6PP
|
156
|
-
#endif
|
157
|
-
|
158
|
-
typedef unsigned char uint8_t;
|
159
|
-
typedef unsigned short uint16_t;
|
160
|
-
typedef unsigned int uint32_t;
|
161
|
-
typedef signed int int32_t;
|
162
|
-
typedef unsigned __int64 uint64_t;
|
163
|
-
typedef signed __int64 int64_t;
|
164
|
-
|
165
|
-
typedef uint16_t fpu_control_t;
|
166
|
-
|
167
|
-
#define ROTL32(a,b) _rotl(a,b)
|
168
|
-
#define ROTR32(a,b) _rotr(a,b)
|
169
|
-
#define ROTL64(a,b) _rotl64(a,b)
|
170
|
-
#define ROTR64(a,b) _rotr64(a,b)
|
171
|
-
|
172
|
-
#define NOINLINE __declspec(noinline)
|
173
|
-
#define INLINE __forceinline
|
174
|
-
#define FASTCALL __fastcall
|
175
|
-
#define CDECL __cdecl
|
176
|
-
#define STDCALL __stdcall
|
177
|
-
#define NAKED __declspec(naked)
|
178
|
-
|
179
|
-
#if defined(_DEBUG)
|
180
|
-
#define mul32x32_64(a,b) (((uint64_t)(a))*(b))
|
181
|
-
#define mul32x32_64s(a,b) (((int64_t)(a))*(b))
|
182
|
-
#else
|
183
|
-
#define mul32x32_64(a,b) __emulu(a,b)
|
184
|
-
#define mul32x32_64s(a,b) __emul(a,b)
|
185
|
-
#endif
|
186
|
-
#endif
|
187
|
-
/* 0100-compiler-999.h */
|
188
|
-
|
189
|
-
#define OPTIONAL_INLINE /* config */
|
190
|
-
#if defined(OPTIONAL_INLINE)
|
191
|
-
#undef OPTIONAL_INLINE
|
192
|
-
#define OPTIONAL_INLINE INLINE
|
193
|
-
#else
|
194
|
-
#define OPTIONAL_INLINE
|
195
|
-
#endif
|
196
|
-
|
197
|
-
#define Preprocessor_ToString(s) #s
|
198
|
-
#define Stringify(s) Preprocessor_ToString(s)
|
199
|
-
|
200
|
-
#include <stdio.h>
|
201
|
-
#include <string.h>
|
202
|
-
|
203
|
-
/* 0200-cpu-100-alpha.h */
|
204
|
-
|
205
|
-
#if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
|
206
|
-
#define CPU_ALPHA
|
207
|
-
#endif
|
208
|
-
|
209
|
-
/* 0200-cpu-100-hppa.h */
|
210
|
-
|
211
|
-
#if defined(__hppa__) || defined(__hppa)
|
212
|
-
#define CPU_HPPA
|
213
|
-
#endif
|
214
|
-
|
215
|
-
/* 0200-cpu-100-intel.h */
|
216
|
-
|
217
|
-
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__ ) || defined(_M_X64)
|
218
|
-
#define CPU_X86_64
|
219
|
-
#elif defined(__i586__) || defined(__i686__) || (defined(_M_IX86) && (_M_IX86 >= 500))
|
220
|
-
#define CPU_X86 500
|
221
|
-
#elif defined(__i486__) || (defined(_M_IX86) && (_M_IX86 >= 400))
|
222
|
-
#define CPU_X86 400
|
223
|
-
#elif defined(__i386__) || (defined(_M_IX86) && (_M_IX86 >= 300)) || defined(__X86__) || defined(_X86_) || defined(__I86__)
|
224
|
-
#define CPU_X86 300
|
225
|
-
#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(_M_IA64) || defined(__ia64)
|
226
|
-
#define CPU_IA64
|
227
|
-
#endif
|
228
|
-
|
229
|
-
/* 0200-cpu-100-ppc.h */
|
230
|
-
|
231
|
-
#if defined(powerpc) || defined(__PPC__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(__powerpc__) || defined(__powerpc) || defined(POWERPC) || defined(_M_PPC)
|
232
|
-
#define CPU_PPC
|
233
|
-
#if defined(_ARCH_PWR7)
|
234
|
-
#define CPU_POWER7
|
235
|
-
#elif defined(__64BIT__)
|
236
|
-
#define CPU_PPC64
|
237
|
-
#else
|
238
|
-
#define CPU_PPC32
|
239
|
-
#endif
|
240
|
-
#endif
|
241
|
-
|
242
|
-
/* 0200-cpu-100-sparc.h */
|
243
|
-
|
244
|
-
#if defined(__sparc__) || defined(__sparc) || defined(__sparcv9)
|
245
|
-
#define CPU_SPARC
|
246
|
-
#if defined(__sparcv9)
|
247
|
-
#define CPU_SPARC64
|
248
|
-
#else
|
249
|
-
#define CPU_SPARC32
|
250
|
-
#endif
|
251
|
-
#endif
|
252
|
-
|
253
|
-
/* 0200-cpu-200-bits.h */
|
254
|
-
|
255
|
-
#if defined(CPU_X86_64) || defined(CPU_IA64) || defined(CPU_SPARC64) || defined(__64BIT__) || defined(__LP64__) || defined(_LP64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64))
|
256
|
-
#define CPU_64BITS
|
257
|
-
|
258
|
-
#undef FASTCALL
|
259
|
-
#undef CDECL
|
260
|
-
#undef STDCALL
|
261
|
-
|
262
|
-
#define FASTCALL
|
263
|
-
#define CDECL
|
264
|
-
#define STDCALL
|
265
|
-
#endif
|
266
|
-
|
267
|
-
/* 0200-cpu-200-endian.h */
|
268
|
-
|
269
|
-
#if ((defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || \
|
270
|
-
(defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && (BYTE_ORDER == LITTLE_ENDIAN)) || \
|
271
|
-
(defined(CPU_X86) || defined(CPU_X86_64)) || \
|
272
|
-
(defined(vax) || defined(MIPSEL) || defined(_MIPSEL)))
|
273
|
-
#define CPU_LE
|
274
|
-
#elif ((defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
|
275
|
-
(defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \
|
276
|
-
(defined(CPU_SPARC) || defined(CPU_PPC) || defined(mc68000) || defined(sel)) || defined(_MIPSEB))
|
277
|
-
#define CPU_BE
|
278
|
-
#else
|
279
|
-
/* unknown endian! */
|
280
|
-
#endif
|
281
|
-
|
282
|
-
#if defined(__s390__) || defined(__zarch__) || defined(__SYSC_ZARCH__)
|
283
|
-
# define CPU_Z390
|
284
|
-
#endif
|
285
|
-
|
286
|
-
/* 0400-endian-100-be.h */
|
287
|
-
|
288
|
-
#if defined(CPU_BE) && !defined(CPU_ALIGNED_ACCESS_REQUIRED)
|
289
|
-
static INLINE uint16_t fU8TO16_BE_FAST(const uint8_t *p) { return *(const uint16_t *)p; }
|
290
|
-
static INLINE uint32_t fU8TO32_BE_FAST(const uint8_t *p) { return *(const uint32_t *)p; }
|
291
|
-
static INLINE uint64_t fU8TO64_BE_FAST(const uint8_t *p) { return *(const uint64_t *)p; }
|
292
|
-
static INLINE void fU16TO8_BE_FAST(uint8_t *p, const uint16_t v) { *(uint16_t *)p = v; }
|
293
|
-
static INLINE void fU32TO8_BE_FAST(uint8_t *p, const uint32_t v) { *(uint32_t *)p = v; }
|
294
|
-
static INLINE void fU64TO8_BE_FAST(uint8_t *p, const uint64_t v) { *(uint64_t *)p = v; }
|
295
|
-
|
296
|
-
#define U8TO16_BE(p) fU8TO16_BE_FAST(p)
|
297
|
-
#define U8TO32_BE(p) fU8TO32_BE_FAST(p)
|
298
|
-
#define U8TO64_BE(p) fU8TO64_BE_FAST(p)
|
299
|
-
#define U16TO8_BE(p, v) fU16TO8_BE_FAST(p, v)
|
300
|
-
#define U32TO8_BE(p, v) fU32TO8_BE_FAST(p, v)
|
301
|
-
#define U64TO8_BE(p, v) fU64TO8_BE_FAST(p, v)
|
302
|
-
#endif
|
303
|
-
|
304
|
-
/* 0400-endian-100-le.h */
|
305
|
-
|
306
|
-
#if defined(CPU_LE) && !defined(CPU_ALIGNED_ACCESS_REQUIRED)
|
307
|
-
static INLINE uint16_t fU8TO16_LE_FAST(const uint8_t *p) { return *(const uint16_t *)p; }
|
308
|
-
static INLINE uint32_t fU8TO32_LE_FAST(const uint8_t *p) { return *(const uint32_t *)p; }
|
309
|
-
static INLINE uint64_t fU8TO64_LE_FAST(const uint8_t *p) { return *(const uint64_t *)p; }
|
310
|
-
static INLINE void fU16TO8_LE_FAST(uint8_t *p, const uint16_t v) { *(uint16_t *)p = v; }
|
311
|
-
static INLINE void fU32TO8_LE_FAST(uint8_t *p, const uint32_t v) { *(uint32_t *)p = v; }
|
312
|
-
static INLINE void fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) { *(uint64_t *)p = v; }
|
313
|
-
|
314
|
-
#define U8TO16_LE(p) fU8TO16_LE_FAST(p)
|
315
|
-
#define U8TO32_LE(p) fU8TO32_LE_FAST(p)
|
316
|
-
#define U8TO64_LE(p) fU8TO64_LE_FAST(p)
|
317
|
-
#define U16TO8_LE(p, v) fU16TO8_LE_FAST(p, v)
|
318
|
-
#define U32TO8_LE(p, v) fU32TO8_LE_FAST(p, v)
|
319
|
-
#define U64TO8_LE(p, v) fU64TO8_LE_FAST(p, v)
|
320
|
-
#endif
|
321
|
-
|
322
|
-
/* 0400-endian-100-ppc.h */
|
323
|
-
|
324
|
-
#if defined(CPU_PPC)
|
325
|
-
#if defined(CPU_POWER7)
|
326
|
-
static INLINE uint64_t fU8TO64_LE_FAST(const uint8_t *p) {
|
327
|
-
uint64_d d;
|
328
|
-
__asm__ ("ldbrx %0,0,%1" : "=r"(d) : "r"(p))
|
329
|
-
return d;
|
330
|
-
}
|
331
|
-
|
332
|
-
static INLINE void
|
333
|
-
fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) {
|
334
|
-
__asm__ ("stdbrx %1,0,%0" : : "r"(p), "r"(v))
|
335
|
-
}
|
336
|
-
#elif defined(CPU_PPC64)
|
337
|
-
static INLINE uint64_t
|
338
|
-
fU8TO64_LE_FAST(const uint8_t *p) {
|
339
|
-
uint64_t *s4, h, d;
|
340
|
-
__asm__ ("addi %0,%3,4;lwbrx %1,0,%3;lwbrx %2,0,%0;rldimi %1,%2,32,0" : "+r"(s4), "=r"(d), "=r"(h) : "b"(p));
|
341
|
-
return d;
|
342
|
-
}
|
343
|
-
|
344
|
-
static INLINE void
|
345
|
-
fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) {
|
346
|
-
uint64_t *s4, h = v >> 32;
|
347
|
-
__asm__ ("addi %0,%3,4;stwbrx %1,0,%3;stwbrx %2,0,%0" : "+r"(s4) : "r"(v), "r"(h), "b"(p));
|
348
|
-
}
|
349
|
-
#elif defined(CPU_PPC32)
|
350
|
-
static INLINE uint64_t
|
351
|
-
fU8TO64_LE_FAST(const uint8_t *p) {
|
352
|
-
uint32_t *s4, h, l;
|
353
|
-
__asm__ ("addi %0,%3,4;lwbrx %1,0,%3;lwbrx %2,0,%0" : "+r"(s4), "=r"(l), "=r"(h) : "b"(p));\
|
354
|
-
return ((uint64_t)h << 32) | l;
|
355
|
-
}
|
356
|
-
|
357
|
-
static INLINE void
|
358
|
-
fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) {
|
359
|
-
uint32_t *s4, h = (uint32_t)(v >> 32), l = (uint32_t)(v & (uint32_t)0xffffffff);
|
360
|
-
__asm__ ("addi %0,%3,4;stwbrx %1,0,%3;stwbrx %2,0,%0" : "+r"(s4) : "r"(l), "r"(h), "b"(p));
|
361
|
-
}
|
362
|
-
#endif
|
363
|
-
|
364
|
-
static INLINE uint32_t
|
365
|
-
fU8TO32_LE_FAST(const uint8_t *p) {
|
366
|
-
uint32_t d;
|
367
|
-
__asm__ ("lwbrx %0,0,%1" : "=r"(d) : "r"(p));
|
368
|
-
return d;
|
369
|
-
}
|
370
|
-
|
371
|
-
static INLINE void
|
372
|
-
fU32TO8_LE_FAST(uint8_t *p, const uint32_t v) {
|
373
|
-
__asm__ __volatile__("stwbrx %1,0,%0" : : "r"(p), "r"(v));
|
374
|
-
}
|
375
|
-
|
376
|
-
#define U8TO32_LE(p) fU8TO32_LE_FAST(p)
|
377
|
-
#define U8TO64_LE(p) fU8TO64_LE_FAST(p)
|
378
|
-
#define U32TO8_LE(p, v) fU32TO8_LE_FAST(p, v)
|
379
|
-
#define U64TO8_LE(p, v) fU64TO8_LE_FAST(p, v)
|
380
|
-
#endif
|
381
|
-
|
382
|
-
/* 0400-endian-100-sparc.h */
|
383
|
-
|
384
|
-
#if defined(CPU_SPARC)
|
385
|
-
#if defined(CPU_SPARC64)
|
386
|
-
static INLINE uint64_t
|
387
|
-
fU8TO64_LE_FAST(const uint8_t *p) {
|
388
|
-
uint64_d d;
|
389
|
-
__asm__ ("ldxa [%1]0x88,%0" : "=r"(d) : "r"(p));
|
390
|
-
return d;
|
391
|
-
}
|
392
|
-
|
393
|
-
static INLINE void
|
394
|
-
fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) {
|
395
|
-
__asm__ ("stxa %0,[%1]0x88" : : "r"(v), "r"(p));
|
396
|
-
}
|
397
|
-
#else
|
398
|
-
static INLINE uint64_t
|
399
|
-
fU8TO64_LE_FAST(const uint8_t *p) {
|
400
|
-
uint32_t *s4, h, l;
|
401
|
-
__asm__ ("add %3,4,%0\n\tlda [%3]0x88,%1\n\tlda [%0]0x88,%2" : "+r"(s4), "=r"(l), "=r"(h) : "r"(p));
|
402
|
-
return ((uint64_t)h << 32) | l;
|
403
|
-
}
|
404
|
-
|
405
|
-
static INLINE void
|
406
|
-
fU64TO8_LE_FAST(uint8_t *p, const uint64_t v) {
|
407
|
-
uint32_t *s4, h = (uint32_t)(v >> 32), l = (uint32_t)(v & (uint32_t)0xffffffff);
|
408
|
-
__asm__ ("add %3,4,%0\n\tsta %1,[%3]0x88\n\tsta %2,[%0]0x88" : "+r"(s4) : "r"(l), "r"(h), "r"(p));
|
409
|
-
}
|
410
|
-
#endif
|
411
|
-
|
412
|
-
static INLINE uint32_t
|
413
|
-
fU8TO32_LE_FAST(const uint8_t *p) {
|
414
|
-
uint32_t d;
|
415
|
-
__asm__ ("lda [%1]0x88,%0" : "=r"(d) : "r"(p));
|
416
|
-
return d;
|
417
|
-
}
|
418
|
-
|
419
|
-
static INLINE void
|
420
|
-
fU32TO8_LE_FAST(uint8_t *p, const uint32_t v) {
|
421
|
-
__asm__ ("sta %0,[%1]0x88" : : "r"(p), "r"(v));
|
422
|
-
}
|
423
|
-
|
424
|
-
#define U8TO32_LE(p) fU8TO32_LE_FAST(p)
|
425
|
-
#define U8TO64_LE(p) fU8TO64_LE_FAST(p)
|
426
|
-
#define U32TO8_LE(p, v) fU32TO8_LE_FAST(p, v)
|
427
|
-
#define U64TO8_LE(p, v) fU64TO8_LE_FAST(p, v)
|
428
|
-
#endif
|
429
|
-
|
430
|
-
/* 0400-endian-100-x86.h */
|
431
|
-
|
432
|
-
#if (((defined(CPU_X86) && (CPU_X86 >= 400)) || defined(CPU_X86_64)) && (defined(COMPILER_MSVC) || defined(COMPILER_GCC)))
|
433
|
-
#if defined(COMPILER_MSVC)
|
434
|
-
static INLINE uint16_t U16_SWAP_FAST(uint16_t v) { return _byteswap_ushort(v); }
|
435
|
-
static INLINE uint32_t U32_SWAP_FAST(uint32_t v) { return _byteswap_ulong(v); }
|
436
|
-
static INLINE uint64_t U64_SWAP_FAST(uint64_t v) { return _byteswap_uint64(v); }
|
437
|
-
#else
|
438
|
-
static INLINE uint16_t U16_SWAP_FAST(uint16_t v) { __asm__("rorw $8,%0" : "+r" (v)); return v; }
|
439
|
-
static INLINE uint32_t U32_SWAP_FAST(uint32_t v) { __asm__("bswap %0" : "+r" (v)); return v; }
|
440
|
-
#if defined(CPU_X86_64)
|
441
|
-
static INLINE uint64_t U64_SWAP_FAST(uint64_t v) { __asm__("bswap %0" : "+r" (v)); return v; }
|
442
|
-
#else
|
443
|
-
static INLINE uint64_t U64_SWAP_FAST(uint64_t v) {
|
444
|
-
uint32_t lo = U32_SWAP_FAST((uint32_t)(v)), hi = U32_SWAP_FAST((uint32_t)(v >> 32));
|
445
|
-
return ((uint64_t)lo << 32) | hi;
|
446
|
-
}
|
447
|
-
#endif
|
448
|
-
#endif
|
449
|
-
|
450
|
-
|
451
|
-
static INLINE uint16_t fU8TO16_BE_FAST(const uint8_t *p) { return U16_SWAP_FAST(*(const uint16_t *)p); }
|
452
|
-
static INLINE uint32_t fU8TO32_BE_FAST(const uint8_t *p) { return U32_SWAP_FAST(*(const uint32_t *)p); }
|
453
|
-
static INLINE uint64_t fU8TO64_BE_FAST(const uint8_t *p) { return U64_SWAP_FAST(*(const uint64_t *)p); }
|
454
|
-
static INLINE void fU16TO8_BE_FAST(uint8_t *p, const uint16_t v) { *(uint16_t *)p = U16_SWAP_FAST(v); }
|
455
|
-
static INLINE void fU32TO8_BE_FAST(uint8_t *p, const uint32_t v) { *(uint32_t *)p = U32_SWAP_FAST(v); }
|
456
|
-
static INLINE void fU64TO8_BE_FAST(uint8_t *p, const uint64_t v) { *(uint64_t *)p = U64_SWAP_FAST(v); }
|
457
|
-
|
458
|
-
#define U16_SWAP(p) U16_SWAP_FAST(p)
|
459
|
-
#define U32_SWAP(p) U32_SWAP_FAST(p)
|
460
|
-
#define U64_SWAP(p) U64_SWAP_FAST(p)
|
461
|
-
#define U8TO16_BE(p) fU8TO16_BE_FAST(p)
|
462
|
-
#define U8TO32_BE(p) fU8TO32_BE_FAST(p)
|
463
|
-
#define U8TO64_BE(p) fU8TO64_BE_FAST(p)
|
464
|
-
#define U16TO8_BE(p, v) fU16TO8_BE_FAST(p, v)
|
465
|
-
#define U32TO8_BE(p, v) fU32TO8_BE_FAST(p, v)
|
466
|
-
#define U64TO8_BE(p, v) fU64TO8_BE_FAST(p, v)
|
467
|
-
#endif
|
468
|
-
|
469
|
-
/* 0400-endian-999-generic-be.h */
|
470
|
-
|
471
|
-
#if !defined(U8TO16_BE)
|
472
|
-
static INLINE uint16_t
|
473
|
-
fU8TO16_BE_SLOW(const uint8_t *p) {
|
474
|
-
return
|
475
|
-
(((uint16_t)(p[0]) << 8) |
|
476
|
-
((uint16_t)(p[1]) ));
|
477
|
-
}
|
478
|
-
|
479
|
-
#define U8TO16_BE(p) fU8TO16_BE_SLOW(p)
|
480
|
-
#endif
|
481
|
-
|
482
|
-
|
483
|
-
#if !defined(U8TO32_BE)
|
484
|
-
static INLINE uint32_t
|
485
|
-
fU8TO32_BE_SLOW(const uint8_t *p) {
|
486
|
-
return
|
487
|
-
(((uint32_t)(p[0]) << 24) |
|
488
|
-
((uint32_t)(p[1]) << 16) |
|
489
|
-
((uint32_t)(p[2]) << 8) |
|
490
|
-
((uint32_t)(p[3]) ));
|
491
|
-
}
|
492
|
-
|
493
|
-
#define U8TO32_BE(p) fU8TO32_BE_SLOW(p)
|
494
|
-
#endif
|
495
|
-
|
496
|
-
#if !defined(U8TO64_BE)
|
497
|
-
static INLINE uint64_t
|
498
|
-
fU8TO64_BE_SLOW(const uint8_t *p) {
|
499
|
-
return
|
500
|
-
(((uint64_t)(p[0]) << 56) |
|
501
|
-
((uint64_t)(p[1]) << 48) |
|
502
|
-
((uint64_t)(p[2]) << 40) |
|
503
|
-
((uint64_t)(p[3]) << 32) |
|
504
|
-
((uint64_t)(p[4]) << 24) |
|
505
|
-
((uint64_t)(p[5]) << 16) |
|
506
|
-
((uint64_t)(p[6]) << 8) |
|
507
|
-
((uint64_t)(p[7]) ));
|
508
|
-
}
|
509
|
-
|
510
|
-
#define U8TO64_BE(p) fU8TO64_BE_SLOW(p)
|
511
|
-
#endif
|
512
|
-
|
513
|
-
#if !defined(U16TO8_BE)
|
514
|
-
static INLINE void
|
515
|
-
fU16TO8_BE_SLOW(uint8_t *p, const uint16_t v) {
|
516
|
-
p[0] = (uint8_t)(v >> 8);
|
517
|
-
p[1] = (uint8_t)(v );
|
518
|
-
}
|
519
|
-
|
520
|
-
#define U16TO8_BE(p, v) fU16TO8_BE_SLOW(p, v)
|
521
|
-
#endif
|
522
|
-
|
523
|
-
#if !defined(U32TO8_BE)
|
524
|
-
static INLINE void
|
525
|
-
fU32TO8_BE_SLOW(uint8_t *p, const uint32_t v) {
|
526
|
-
p[0] = (uint8_t)(v >> 24);
|
527
|
-
p[1] = (uint8_t)(v >> 16);
|
528
|
-
p[2] = (uint8_t)(v >> 8);
|
529
|
-
p[3] = (uint8_t)(v );
|
530
|
-
}
|
531
|
-
|
532
|
-
#define U32TO8_BE(p, v) fU32TO8_BE_SLOW(p, v)
|
533
|
-
#endif
|
534
|
-
|
535
|
-
#if !defined(U64TO8_BE)
|
536
|
-
static INLINE void
|
537
|
-
fU64TO8_BE_SLOW(uint8_t *p, const uint64_t v) {
|
538
|
-
p[0] = (uint8_t)(v >> 56);
|
539
|
-
p[1] = (uint8_t)(v >> 48);
|
540
|
-
p[2] = (uint8_t)(v >> 40);
|
541
|
-
p[3] = (uint8_t)(v >> 32);
|
542
|
-
p[4] = (uint8_t)(v >> 24);
|
543
|
-
p[5] = (uint8_t)(v >> 16);
|
544
|
-
p[6] = (uint8_t)(v >> 8);
|
545
|
-
p[7] = (uint8_t)(v );
|
546
|
-
}
|
547
|
-
|
548
|
-
#define U64TO8_BE(p, v) fU64TO8_BE_SLOW(p, v)
|
549
|
-
#endif
|
550
|
-
|
551
|
-
/* 0400-endian-999-generic-le.h */
|
552
|
-
|
553
|
-
#if !defined(U8TO16_LE)
|
554
|
-
static INLINE uint16_t
|
555
|
-
fU8TO16_LE_SLOW(const uint8_t *p) {
|
556
|
-
return
|
557
|
-
(((uint16_t)(p[0]) ) |
|
558
|
-
((uint16_t)(p[1]) << 8));
|
559
|
-
}
|
560
|
-
|
561
|
-
#define U8TO16_LE(p) fU8TO16_LE_SLOW(p)
|
562
|
-
#endif
|
563
|
-
|
564
|
-
#if !defined(U8TO32_LE)
|
565
|
-
static INLINE uint32_t
|
566
|
-
fU8TO32_LE_SLOW(const uint8_t *p) {
|
567
|
-
return
|
568
|
-
(((uint32_t)(p[0]) ) |
|
569
|
-
((uint32_t)(p[1]) << 8) |
|
570
|
-
((uint32_t)(p[2]) << 16) |
|
571
|
-
((uint32_t)(p[3]) << 24));
|
572
|
-
}
|
573
|
-
|
574
|
-
#define U8TO32_LE(p) fU8TO32_LE_SLOW(p)
|
575
|
-
#endif
|
576
|
-
|
577
|
-
|
578
|
-
#if !defined(U8TO64_LE)
|
579
|
-
static INLINE uint64_t
|
580
|
-
fU8TO64_LE_SLOW(const uint8_t *p) {
|
581
|
-
return
|
582
|
-
(((uint64_t)(p[0]) ) |
|
583
|
-
((uint64_t)(p[1]) << 8) |
|
584
|
-
((uint64_t)(p[2]) << 16) |
|
585
|
-
((uint64_t)(p[3]) << 24) |
|
586
|
-
((uint64_t)(p[4]) << 32) |
|
587
|
-
((uint64_t)(p[5]) << 40) |
|
588
|
-
((uint64_t)(p[6]) << 48) |
|
589
|
-
((uint64_t)(p[7]) << 56));
|
590
|
-
}
|
591
|
-
|
592
|
-
#define U8TO64_LE(p) fU8TO64_LE_SLOW(p)
|
593
|
-
#endif
|
594
|
-
|
595
|
-
#if !defined(U16TO8_LE)
|
596
|
-
static INLINE void
|
597
|
-
fU16TO8_LE_SLOW(uint8_t *p, const uint16_t v) {
|
598
|
-
p[0] = (uint8_t)(v );
|
599
|
-
p[1] = (uint8_t)(v >> 8);
|
600
|
-
}
|
601
|
-
|
602
|
-
#define U16TO8_LE(p, v) fU16TO8_LE_SLOW(p, v)
|
603
|
-
#endif
|
604
|
-
|
605
|
-
#if !defined(U32TO8_LE)
|
606
|
-
static INLINE void
|
607
|
-
fU32TO8_LE_SLOW(uint8_t *p, const uint32_t v) {
|
608
|
-
p[0] = (uint8_t)(v );
|
609
|
-
p[1] = (uint8_t)(v >> 8);
|
610
|
-
p[2] = (uint8_t)(v >> 16);
|
611
|
-
p[3] = (uint8_t)(v >> 24);
|
612
|
-
}
|
613
|
-
|
614
|
-
#define U32TO8_LE(p, v) fU32TO8_LE_SLOW(p, v)
|
615
|
-
#endif
|
616
|
-
|
617
|
-
#if !defined(U64TO8_LE)
|
618
|
-
static INLINE void
|
619
|
-
fU64TO8_LE_SLOW(uint8_t *p, const uint64_t v) {
|
620
|
-
p[0] = (uint8_t)(v );
|
621
|
-
p[1] = (uint8_t)(v >> 8);
|
622
|
-
p[2] = (uint8_t)(v >> 16);
|
623
|
-
p[3] = (uint8_t)(v >> 24);
|
624
|
-
p[4] = (uint8_t)(v >> 32);
|
625
|
-
p[5] = (uint8_t)(v >> 40);
|
626
|
-
p[6] = (uint8_t)(v >> 48);
|
627
|
-
p[7] = (uint8_t)(v >> 56);
|
628
|
-
}
|
629
|
-
|
630
|
-
#define U64TO8_LE(p, v) fU64TO8_LE_SLOW(p, v)
|
631
|
-
#endif
|
632
|
-
|
633
|
-
/* 0400-endian-999-generic-swap.h */
|
634
|
-
|
635
|
-
#if !defined(U16_SWAP)
|
636
|
-
static INLINE uint16_t
|
637
|
-
fU16_SWAP_SLOW(uint16_t v) {
|
638
|
-
v = (v << 8) | (v >> 8);
|
639
|
-
return v;
|
640
|
-
}
|
641
|
-
|
642
|
-
#define U16_SWAP(p) fU16_SWAP_SLOW(p)
|
643
|
-
#endif
|
644
|
-
|
645
|
-
#if !defined(U32_SWAP)
|
646
|
-
static INLINE uint32_t
|
647
|
-
fU32_SWAP_SLOW(uint32_t v) {
|
648
|
-
v = ((v << 8) & 0xFF00FF00) | ((v >> 8) & 0xFF00FF);
|
649
|
-
v = (v << 16) | (v >> 16);
|
650
|
-
return v;
|
651
|
-
}
|
652
|
-
|
653
|
-
#define U32_SWAP(p) fU32_SWAP_SLOW(p)
|
654
|
-
#endif
|
655
|
-
|
656
|
-
#if !defined(U64_SWAP)
|
657
|
-
static INLINE uint64_t
|
658
|
-
fU64_SWAP_SLOW(uint64_t v) {
|
659
|
-
v = ((v << 8) & 0xFF00FF00FF00FF00ull) | ((v >> 8) & 0x00FF00FF00FF00FFull);
|
660
|
-
v = ((v << 16) & 0xFFFF0000FFFF0000ull) | ((v >> 16) & 0x0000FFFF0000FFFFull);
|
661
|
-
v = (v << 32) | (v >> 32);
|
662
|
-
return v;
|
663
|
-
}
|
664
|
-
|
665
|
-
#define U64_SWAP(p) fU64_SWAP_SLOW(p)
|
666
|
-
#endif
|
667
|
-
|
668
|
-
/* 0400-uint128-000.h */
|
669
|
-
|
670
|
-
/* 0400-uint128-100-clang.h */
|
671
|
-
|
672
|
-
#ifdef HAVE_TI_MODE
|
673
|
-
# define HAVE_NATIVE_UINT128
|
674
|
-
typedef unsigned uint128_t __attribute__((mode(TI)));
|
675
|
-
#endif
|
676
|
-
|
677
|
-
/* 0400-uint128-100-msvc.h */
|
678
|
-
|
679
|
-
#if defined(CPU_64BITS) && defined(COMPILER_MSVC)
|
680
|
-
#define HAVE_UINT128
|
681
|
-
|
682
|
-
typedef struct uint128 {
|
683
|
-
uint64_t lo, hi;
|
684
|
-
} uint128_t;
|
685
|
-
|
686
|
-
static INLINE uint128_t
|
687
|
-
mul64x64_128(uint64_t a, uint64_t b) {
|
688
|
-
uint128_t v;
|
689
|
-
v.lo = _umul128(a, b, &v.hi);
|
690
|
-
return v;
|
691
|
-
}
|
692
|
-
|
693
|
-
static INLINE uint64_t
|
694
|
-
shr128_pair(uint64_t hi, uint64_t lo, const int shift) {
|
695
|
-
return __shiftright128(lo, hi, shift);
|
696
|
-
}
|
697
|
-
|
698
|
-
static INLINE uint64_t
|
699
|
-
shr128(uint128_t v, const int shift) {
|
700
|
-
return __shiftright128(v.lo, v.hi, shift);
|
701
|
-
}
|
702
|
-
|
703
|
-
static INLINE uint128_t
|
704
|
-
add128(uint128_t a, uint128_t b) {
|
705
|
-
uint64_t t = a.lo;
|
706
|
-
a.lo += b.lo;
|
707
|
-
a.hi += b.hi + (a.lo < t);
|
708
|
-
return a;
|
709
|
-
}
|
710
|
-
|
711
|
-
static INLINE uint128_t
|
712
|
-
add128_64(uint128_t a, uint64_t b) {
|
713
|
-
uint64_t t = a.lo;
|
714
|
-
a.lo += b;
|
715
|
-
a.hi += (a.lo < t);
|
716
|
-
return a;
|
717
|
-
}
|
718
|
-
|
719
|
-
static INLINE uint64_t
|
720
|
-
lo128(uint128_t a) {
|
721
|
-
return a.lo;
|
722
|
-
}
|
723
|
-
|
724
|
-
static INLINE uint64_t
|
725
|
-
hi128(uint128_t a) {
|
726
|
-
return a.hi;
|
727
|
-
}
|
728
|
-
#endif
|
729
|
-
|
730
|
-
/* 0400-uint128-999.h */
|
731
|
-
|
732
|
-
#if defined(HAVE_NATIVE_UINT128)
|
733
|
-
#define HAVE_UINT128
|
734
|
-
|
735
|
-
static INLINE uint128_t
|
736
|
-
mul64x64_128(uint64_t a, uint64_t b) {
|
737
|
-
return (uint128_t)a * b;
|
738
|
-
}
|
739
|
-
|
740
|
-
static INLINE uint64_t
|
741
|
-
shr128(uint128_t v, const int shift) {
|
742
|
-
return (uint64_t)(v >> shift);
|
743
|
-
}
|
744
|
-
|
745
|
-
static INLINE uint64_t
|
746
|
-
shr128_pair(uint64_t hi, uint64_t lo, const int shift) {
|
747
|
-
return (uint64_t)((((uint128_t)hi << 64) | lo) >> shift);
|
748
|
-
}
|
749
|
-
|
750
|
-
static INLINE uint128_t
|
751
|
-
add128(uint128_t a, uint128_t b) {
|
752
|
-
return a + b;
|
753
|
-
}
|
754
|
-
|
755
|
-
static INLINE uint128_t
|
756
|
-
add128_64(uint128_t a, uint64_t b) {
|
757
|
-
return a + b;
|
758
|
-
}
|
759
|
-
|
760
|
-
static INLINE uint64_t
|
761
|
-
lo128(uint128_t a) {
|
762
|
-
return (uint64_t)a;
|
763
|
-
}
|
764
|
-
|
765
|
-
static INLINE uint64_t
|
766
|
-
hi128(uint128_t a) {
|
767
|
-
return (uint64_t)(a >> 64);
|
768
|
-
}
|
769
|
-
#endif
|
770
|
-
|
771
|
-
#endif /* PORTABLE_JANE_H */
|
772
|
-
|