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,3 +1,6 @@
|
|
1
|
+
|
2
|
+
#include <string.h>
|
3
|
+
|
1
4
|
#include "api.h"
|
2
5
|
#include "crypto_hash_sha512.h"
|
3
6
|
#include "ge.h"
|
@@ -9,11 +12,13 @@ int crypto_sign(
|
|
9
12
|
const unsigned char *sk
|
10
13
|
)
|
11
14
|
{
|
15
|
+
unsigned char pk[32];
|
12
16
|
unsigned char az[64];
|
13
|
-
unsigned char
|
17
|
+
unsigned char nonce[64];
|
14
18
|
unsigned char hram[64];
|
15
19
|
ge_p3 R;
|
16
|
-
|
20
|
+
|
21
|
+
memmove(pk,sk + 32,32);
|
17
22
|
|
18
23
|
crypto_hash_sha512(az,sk,32);
|
19
24
|
az[0] &= 248;
|
@@ -21,18 +26,18 @@ int crypto_sign(
|
|
21
26
|
az[31] |= 64;
|
22
27
|
|
23
28
|
*smlen = mlen + 64;
|
24
|
-
|
25
|
-
|
26
|
-
crypto_hash_sha512(
|
27
|
-
|
29
|
+
memmove(sm + 64,m,mlen);
|
30
|
+
memmove(sm + 32,az + 32,32);
|
31
|
+
crypto_hash_sha512(nonce,sm + 32,mlen + 32);
|
32
|
+
memmove(sm + 32,pk,32);
|
28
33
|
|
29
|
-
sc_reduce(
|
30
|
-
ge_scalarmult_base(&R,
|
34
|
+
sc_reduce(nonce);
|
35
|
+
ge_scalarmult_base(&R,nonce);
|
31
36
|
ge_p3_tobytes(sm,&R);
|
32
37
|
|
33
38
|
crypto_hash_sha512(hram,sm,mlen + 64);
|
34
39
|
sc_reduce(hram);
|
35
|
-
sc_muladd(sm + 32,hram,az,
|
40
|
+
sc_muladd(sm + 32,hram,az,nonce);
|
36
41
|
|
37
42
|
return 0;
|
38
43
|
}
|
@@ -7,7 +7,6 @@
|
|
7
7
|
#define crypto_sign_BYTES crypto_sign_edwards25519sha512batch_BYTES
|
8
8
|
#define crypto_sign_PUBLICKEYBYTES crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES
|
9
9
|
#define crypto_sign_SECRETKEYBYTES crypto_sign_edwards25519sha512batch_SECRETKEYBYTES
|
10
|
-
#define crypto_sign_PRIMITIVE "edwards25519sha512batch"
|
11
10
|
#define crypto_sign_IMPLEMENTATION crypto_sign_edwards25519sha512batch_IMPLEMENTATION
|
12
11
|
#define crypto_sign_VERSION crypto_sign_edwards25519sha512batch_VERSION
|
13
12
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
#include "common.h"
|
8
8
|
#include "consts.h"
|
9
9
|
|
10
|
-
int crypto_stream_afternm(unsigned char *
|
10
|
+
int crypto_stream_afternm(unsigned char *out, unsigned long long len, const unsigned char *nonce, const unsigned char *c)
|
11
11
|
{
|
12
12
|
|
13
13
|
int128 xmm0;
|
@@ -38,7 +38,7 @@ int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const uns
|
|
38
38
|
uint32 tmp;
|
39
39
|
|
40
40
|
/* Copy nonce on the stack */
|
41
|
-
copy2(&nonce_stack, (const int128 *) (
|
41
|
+
copy2(&nonce_stack, (const int128 *) (nonce + 0));
|
42
42
|
np = (unsigned char *)&nonce_stack;
|
43
43
|
|
44
44
|
enc_block:
|
@@ -92,17 +92,17 @@ int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const uns
|
|
92
92
|
tmp += 8;
|
93
93
|
store32_bigendian(np + 12, tmp);
|
94
94
|
|
95
|
-
*(int128 *) (
|
96
|
-
*(int128 *) (
|
97
|
-
*(int128 *) (
|
98
|
-
*(int128 *) (
|
99
|
-
*(int128 *) (
|
100
|
-
*(int128 *) (
|
101
|
-
*(int128 *) (
|
102
|
-
*(int128 *) (
|
95
|
+
*(int128 *) (out + 0) = xmm8;
|
96
|
+
*(int128 *) (out + 16) = xmm9;
|
97
|
+
*(int128 *) (out + 32) = xmm12;
|
98
|
+
*(int128 *) (out + 48) = xmm14;
|
99
|
+
*(int128 *) (out + 64) = xmm11;
|
100
|
+
*(int128 *) (out + 80) = xmm15;
|
101
|
+
*(int128 *) (out + 96) = xmm10;
|
102
|
+
*(int128 *) (out + 112) = xmm13;
|
103
103
|
|
104
104
|
len -= 128;
|
105
|
-
|
105
|
+
out += 128;
|
106
106
|
|
107
107
|
goto enc_block;
|
108
108
|
|
@@ -130,10 +130,10 @@ int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const uns
|
|
130
130
|
if(lensav == 0) goto end;
|
131
131
|
|
132
132
|
b = blp[0]; /* clang false positive */
|
133
|
-
*(unsigned char *)(
|
133
|
+
*(unsigned char *)(out + 0) = b;
|
134
134
|
|
135
135
|
blp += 1;
|
136
|
-
|
136
|
+
out +=1;
|
137
137
|
lensav -= 1;
|
138
138
|
|
139
139
|
goto bytes;
|
@@ -144,14 +144,14 @@ int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const uns
|
|
144
144
|
tmp += 8;
|
145
145
|
store32_bigendian(np + 12, tmp);
|
146
146
|
|
147
|
-
*(int128 *) (
|
148
|
-
*(int128 *) (
|
149
|
-
*(int128 *) (
|
150
|
-
*(int128 *) (
|
151
|
-
*(int128 *) (
|
152
|
-
*(int128 *) (
|
153
|
-
*(int128 *) (
|
154
|
-
*(int128 *) (
|
147
|
+
*(int128 *) (out + 0) = xmm8;
|
148
|
+
*(int128 *) (out + 16) = xmm9;
|
149
|
+
*(int128 *) (out + 32) = xmm12;
|
150
|
+
*(int128 *) (out + 48) = xmm14;
|
151
|
+
*(int128 *) (out + 64) = xmm11;
|
152
|
+
*(int128 *) (out + 80) = xmm15;
|
153
|
+
*(int128 *) (out + 96) = xmm10;
|
154
|
+
*(int128 *) (out + 112) = xmm13;
|
155
155
|
|
156
156
|
end:
|
157
157
|
return 0;
|
@@ -9,6 +9,5 @@
|
|
9
9
|
#define crypto_stream_KEYBYTES crypto_stream_aes128ctr_KEYBYTES
|
10
10
|
#define crypto_stream_NONCEBYTES crypto_stream_aes128ctr_NONCEBYTES
|
11
11
|
#define crypto_stream_BEFORENMBYTES crypto_stream_aes128ctr_BEFORENMBYTES
|
12
|
-
#define crypto_stream_PRIMITIVE "aes128ctr"
|
13
12
|
#define crypto_stream_IMPLEMENTATION crypto_stream_aes128ctr_IMPLEMENTATION
|
14
13
|
#define crypto_stream_VERSION crypto_stream_aes128ctr_VERSION
|
data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
#include "common.h"
|
9
9
|
#include "consts.h"
|
10
10
|
|
11
|
-
int crypto_stream_xor_afternm(unsigned char *
|
11
|
+
int crypto_stream_xor_afternm(unsigned char *out, const unsigned char *in, unsigned long long len, const unsigned char *nonce, const unsigned char *c)
|
12
12
|
{
|
13
13
|
|
14
14
|
int128 xmm0;
|
@@ -39,7 +39,7 @@ int crypto_stream_xor_afternm(unsigned char *outp, const unsigned char *inp, uns
|
|
39
39
|
uint32 tmp;
|
40
40
|
|
41
41
|
/* Copy nonce on the stack */
|
42
|
-
copy2(&nonce_stack, (const int128 *) (
|
42
|
+
copy2(&nonce_stack, (const int128 *) (nonce + 0));
|
43
43
|
np = (unsigned char *)&nonce_stack;
|
44
44
|
|
45
45
|
enc_block:
|
@@ -93,27 +93,27 @@ int crypto_stream_xor_afternm(unsigned char *outp, const unsigned char *inp, uns
|
|
93
93
|
tmp += 8;
|
94
94
|
store32_bigendian(np + 12, tmp);
|
95
95
|
|
96
|
-
xor2(&xmm8, (const int128 *)(
|
97
|
-
xor2(&xmm9, (const int128 *)(
|
98
|
-
xor2(&xmm12, (const int128 *)(
|
99
|
-
xor2(&xmm14, (const int128 *)(
|
100
|
-
xor2(&xmm11, (const int128 *)(
|
101
|
-
xor2(&xmm15, (const int128 *)(
|
102
|
-
xor2(&xmm10, (const int128 *)(
|
103
|
-
xor2(&xmm13, (const int128 *)(
|
104
|
-
|
105
|
-
*(int128 *) (
|
106
|
-
*(int128 *) (
|
107
|
-
*(int128 *) (
|
108
|
-
*(int128 *) (
|
109
|
-
*(int128 *) (
|
110
|
-
*(int128 *) (
|
111
|
-
*(int128 *) (
|
112
|
-
*(int128 *) (
|
96
|
+
xor2(&xmm8, (const int128 *)(in + 0));
|
97
|
+
xor2(&xmm9, (const int128 *)(in + 16));
|
98
|
+
xor2(&xmm12, (const int128 *)(in + 32));
|
99
|
+
xor2(&xmm14, (const int128 *)(in + 48));
|
100
|
+
xor2(&xmm11, (const int128 *)(in + 64));
|
101
|
+
xor2(&xmm15, (const int128 *)(in + 80));
|
102
|
+
xor2(&xmm10, (const int128 *)(in + 96));
|
103
|
+
xor2(&xmm13, (const int128 *)(in + 112));
|
104
|
+
|
105
|
+
*(int128 *) (out + 0) = xmm8;
|
106
|
+
*(int128 *) (out + 16) = xmm9;
|
107
|
+
*(int128 *) (out + 32) = xmm12;
|
108
|
+
*(int128 *) (out + 48) = xmm14;
|
109
|
+
*(int128 *) (out + 64) = xmm11;
|
110
|
+
*(int128 *) (out + 80) = xmm15;
|
111
|
+
*(int128 *) (out + 96) = xmm10;
|
112
|
+
*(int128 *) (out + 112) = xmm13;
|
113
113
|
|
114
114
|
len -= 128;
|
115
|
-
|
116
|
-
|
115
|
+
in += 128;
|
116
|
+
out += 128;
|
117
117
|
|
118
118
|
goto enc_block;
|
119
119
|
|
@@ -141,12 +141,12 @@ int crypto_stream_xor_afternm(unsigned char *outp, const unsigned char *inp, uns
|
|
141
141
|
if(lensav == 0) goto end;
|
142
142
|
|
143
143
|
b = blp[0]; /* clang false positive */
|
144
|
-
b ^= *(const unsigned char *)(
|
145
|
-
*(unsigned char *)(
|
144
|
+
b ^= *(const unsigned char *)(in + 0);
|
145
|
+
*(unsigned char *)(out + 0) = b;
|
146
146
|
|
147
147
|
blp += 1;
|
148
|
-
|
149
|
-
|
148
|
+
in +=1;
|
149
|
+
out +=1;
|
150
150
|
lensav -= 1;
|
151
151
|
|
152
152
|
goto bytes;
|
@@ -157,23 +157,23 @@ int crypto_stream_xor_afternm(unsigned char *outp, const unsigned char *inp, uns
|
|
157
157
|
tmp += 8;
|
158
158
|
store32_bigendian(np + 12, tmp);
|
159
159
|
|
160
|
-
xor2(&xmm8, (const int128 *)(
|
161
|
-
xor2(&xmm9, (const int128 *)(
|
162
|
-
xor2(&xmm12, (const int128 *)(
|
163
|
-
xor2(&xmm14, (const int128 *)(
|
164
|
-
xor2(&xmm11, (const int128 *)(
|
165
|
-
xor2(&xmm15, (const int128 *)(
|
166
|
-
xor2(&xmm10, (const int128 *)(
|
167
|
-
xor2(&xmm13, (const int128 *)(
|
168
|
-
|
169
|
-
*(int128 *) (
|
170
|
-
*(int128 *) (
|
171
|
-
*(int128 *) (
|
172
|
-
*(int128 *) (
|
173
|
-
*(int128 *) (
|
174
|
-
*(int128 *) (
|
175
|
-
*(int128 *) (
|
176
|
-
*(int128 *) (
|
160
|
+
xor2(&xmm8, (const int128 *)(in + 0));
|
161
|
+
xor2(&xmm9, (const int128 *)(in + 16));
|
162
|
+
xor2(&xmm12, (const int128 *)(in + 32));
|
163
|
+
xor2(&xmm14, (const int128 *)(in + 48));
|
164
|
+
xor2(&xmm11, (const int128 *)(in + 64));
|
165
|
+
xor2(&xmm15, (const int128 *)(in + 80));
|
166
|
+
xor2(&xmm10, (const int128 *)(in + 96));
|
167
|
+
xor2(&xmm13, (const int128 *)(in + 112));
|
168
|
+
|
169
|
+
*(int128 *) (out + 0) = xmm8;
|
170
|
+
*(int128 *) (out + 16) = xmm9;
|
171
|
+
*(int128 *) (out + 32) = xmm12;
|
172
|
+
*(int128 *) (out + 48) = xmm14;
|
173
|
+
*(int128 *) (out + 64) = xmm11;
|
174
|
+
*(int128 *) (out + 80) = xmm15;
|
175
|
+
*(int128 *) (out + 96) = xmm10;
|
176
|
+
*(int128 *) (out + 112) = xmm13;
|
177
177
|
|
178
178
|
end:
|
179
179
|
return 0;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#ifndef __AES_TABLE_BE_H__
|
3
3
|
#define __AES_TABLE_BE_H__
|
4
4
|
|
5
|
-
unsigned int T0[256] = {
|
5
|
+
static unsigned int T0[256] = {
|
6
6
|
0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
|
7
7
|
0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
|
8
8
|
0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
|
@@ -70,7 +70,7 @@ unsigned int T0[256] = {
|
|
70
70
|
};
|
71
71
|
|
72
72
|
|
73
|
-
unsigned int T1[256] = {
|
73
|
+
static unsigned int T1[256] = {
|
74
74
|
0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
|
75
75
|
0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
|
76
76
|
0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
|
@@ -137,7 +137,7 @@ unsigned int T1[256] = {
|
|
137
137
|
0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616
|
138
138
|
};
|
139
139
|
|
140
|
-
unsigned int T2[256] = {
|
140
|
+
static unsigned int T2[256] = {
|
141
141
|
0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
|
142
142
|
0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
|
143
143
|
0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
|
@@ -204,7 +204,7 @@ unsigned int T2[256] = {
|
|
204
204
|
0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16
|
205
205
|
};
|
206
206
|
|
207
|
-
unsigned int T3[256] = {
|
207
|
+
static unsigned int T3[256] = {
|
208
208
|
0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
|
209
209
|
0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
|
210
210
|
0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#ifndef __AES_TABLE_LE_H__
|
3
3
|
#define __AES_TABLE_LE_H__
|
4
4
|
|
5
|
-
unsigned int T0[256] = {
|
5
|
+
static unsigned int T0[256] = {
|
6
6
|
0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6,
|
7
7
|
0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591,
|
8
8
|
0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56,
|
@@ -70,7 +70,7 @@ unsigned int T0[256] = {
|
|
70
70
|
};
|
71
71
|
|
72
72
|
|
73
|
-
unsigned int T1[256] = {
|
73
|
+
static unsigned int T1[256] = {
|
74
74
|
0x6363c6a5, 0x7c7cf884, 0x7777ee99, 0x7b7bf68d,
|
75
75
|
0xf2f2ff0d, 0x6b6bd6bd, 0x6f6fdeb1, 0xc5c59154,
|
76
76
|
0x30306050, 0x01010203, 0x6767cea9, 0x2b2b567d,
|
@@ -137,7 +137,7 @@ unsigned int T1[256] = {
|
|
137
137
|
0xb0b07bcb, 0x5454a8fc, 0xbbbb6dd6, 0x16162c3a
|
138
138
|
};
|
139
139
|
|
140
|
-
unsigned int T2[256] = {
|
140
|
+
static unsigned int T2[256] = {
|
141
141
|
0x63c6a563, 0x7cf8847c, 0x77ee9977, 0x7bf68d7b,
|
142
142
|
0xf2ff0df2, 0x6bd6bd6b, 0x6fdeb16f, 0xc59154c5,
|
143
143
|
0x30605030, 0x01020301, 0x67cea967, 0x2b567d2b,
|
@@ -204,7 +204,7 @@ unsigned int T2[256] = {
|
|
204
204
|
0xb07bcbb0, 0x54a8fc54, 0xbb6dd6bb, 0x162c3a16
|
205
205
|
};
|
206
206
|
|
207
|
-
unsigned int T3[256] = {
|
207
|
+
static unsigned int T3[256] = {
|
208
208
|
0xc6a56363, 0xf8847c7c, 0xee997777, 0xf68d7b7b,
|
209
209
|
0xff0df2f2, 0xd6bd6b6b, 0xdeb16f6f, 0x9154c5c5,
|
210
210
|
0x60503030, 0x02030101, 0xcea96767, 0x567d2b2b,
|
@@ -27,7 +27,7 @@ ECRYPT_keysetup(ECRYPT_ctx* ctx, const u8* key, u32 keysize, u32 ivsize)
|
|
27
27
|
w[i] = key[(i << 2)];
|
28
28
|
w[i] |= key[(i << 2)+1] << 8;
|
29
29
|
w[i] |= key[(i << 2)+2] << 16;
|
30
|
-
w[i] |= key[(i << 2)+3] << 24;
|
30
|
+
w[i] |= (unsigned int) key[(i << 2)+3] << 24;
|
31
31
|
}
|
32
32
|
|
33
33
|
i = Nk;
|
@@ -35,7 +35,7 @@ ECRYPT_keysetup(ECRYPT_ctx* ctx, const u8* key, u32 keysize, u32 ivsize)
|
|
35
35
|
while( i < Nb*(Nr+1) ) {
|
36
36
|
temp = w[i-1];
|
37
37
|
|
38
|
-
temp = Sbox[
|
38
|
+
temp = (unsigned int) Sbox[temp & 0xFF] << 24 ^
|
39
39
|
Sbox[(temp >> 8) & 0xFF] ^
|
40
40
|
(Sbox[(temp >> 16) & 0xFF] << 8 ) ^
|
41
41
|
(Sbox[(temp >> 24) & 0xFF] << 16) ^
|
@@ -56,10 +56,10 @@ ECRYPT_keysetup(ECRYPT_ctx* ctx, const u8* key, u32 keysize, u32 ivsize)
|
|
56
56
|
i++;
|
57
57
|
|
58
58
|
temp = w[i-1];
|
59
|
-
temp = Sbox[
|
59
|
+
temp = Sbox[temp & 0xFF] ^
|
60
60
|
Sbox[(temp >> 8) & 0xFF] << 8 ^
|
61
|
-
(Sbox[(temp >> 16) & 0xFF] << 16
|
62
|
-
(Sbox[(temp >> 24) & 0xFF] << 24);
|
61
|
+
(Sbox[(temp >> 16) & 0xFF] << 16) ^
|
62
|
+
((unsigned int) Sbox[(temp >> 24) & 0xFF] << 24);
|
63
63
|
w[i] = w[i-Nk] ^ temp;
|
64
64
|
i++;
|
65
65
|
|
@@ -186,30 +186,30 @@ crypto_stream_beforenm(unsigned char *c, const unsigned char *k)
|
|
186
186
|
}
|
187
187
|
|
188
188
|
int
|
189
|
-
crypto_stream_afternm(unsigned char *
|
190
|
-
const unsigned char *
|
189
|
+
crypto_stream_afternm(unsigned char *out, unsigned long long len,
|
190
|
+
const unsigned char *nonce, const unsigned char *c)
|
191
191
|
{
|
192
192
|
ECRYPT_ctx * const ctx = (ECRYPT_ctx *) c;
|
193
193
|
unsigned long long i;
|
194
194
|
|
195
|
-
ECRYPT_ivsetup(ctx,
|
195
|
+
ECRYPT_ivsetup(ctx, nonce);
|
196
196
|
for (i = 0U; i < len; ++i) {
|
197
|
-
|
197
|
+
out[i] = 0U;
|
198
198
|
}
|
199
|
-
ECRYPT_encrypt_bytes(ctx, (u8 *)
|
199
|
+
ECRYPT_encrypt_bytes(ctx, (u8 *) out, (u8 *) out, len);
|
200
200
|
|
201
201
|
return 0;
|
202
202
|
}
|
203
203
|
|
204
204
|
int
|
205
|
-
crypto_stream_xor_afternm(unsigned char *
|
206
|
-
unsigned long long len, const unsigned char *
|
205
|
+
crypto_stream_xor_afternm(unsigned char *out, const unsigned char *in,
|
206
|
+
unsigned long long len, const unsigned char *nonce,
|
207
207
|
const unsigned char *c)
|
208
208
|
{
|
209
209
|
ECRYPT_ctx * const ctx = (ECRYPT_ctx *) c;
|
210
210
|
|
211
|
-
ECRYPT_ivsetup(ctx,
|
212
|
-
ECRYPT_encrypt_bytes(ctx, (const u8 *)
|
211
|
+
ECRYPT_ivsetup(ctx, nonce);
|
212
|
+
ECRYPT_encrypt_bytes(ctx, (const u8 *) in, (u8 *) out, len);
|
213
213
|
|
214
214
|
return 0;
|
215
215
|
}
|
@@ -219,6 +219,7 @@ crypto_stream(unsigned char *out, unsigned long long outlen,
|
|
219
219
|
const unsigned char *n, const unsigned char *k)
|
220
220
|
{
|
221
221
|
unsigned char d[crypto_stream_BEFORENMBYTES];
|
222
|
+
|
222
223
|
crypto_stream_beforenm(d, k);
|
223
224
|
crypto_stream_afternm(out, outlen, n, d);
|
224
225
|
|