rbnacl-libsodium 0.4.5a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +35 -0
- data/.gitmodules +3 -0
- data/CHANGES.md +3 -0
- data/Gemfile +6 -0
- data/LICENSE +21 -0
- data/README.md +23 -0
- data/Rakefile +1 -0
- data/ext/rbnacl/extconf.rb +30 -0
- data/lib/rbnacl/libsodium.rb +11 -0
- data/lib/rbnacl/libsodium/version.rb +5 -0
- data/rbnacl-libsodium.gemspec +25 -0
- data/vendor/libsodium/AUTHORS +101 -0
- data/vendor/libsodium/ChangeLog +68 -0
- data/vendor/libsodium/LICENSE +16 -0
- data/vendor/libsodium/Makefile.am +20 -0
- data/vendor/libsodium/README +1 -0
- data/vendor/libsodium/README.markdown +246 -0
- data/vendor/libsodium/THANKS +17 -0
- data/vendor/libsodium/autogen.sh +16 -0
- data/vendor/libsodium/configure.ac +405 -0
- data/vendor/libsodium/dist-build/android.sh +48 -0
- data/vendor/libsodium/dist-build/iphone.sh +16 -0
- data/vendor/libsodium/dist-build/msys.sh +9 -0
- data/vendor/libsodium/libsodium.pc.in +11 -0
- data/vendor/libsodium/libsodium.sln +38 -0
- data/vendor/libsodium/libsodium.vcxproj +508 -0
- data/vendor/libsodium/libsodium.vcxproj.filters +569 -0
- data/vendor/libsodium/logo.png +0 -0
- data/vendor/libsodium/m4/ax_check_compile_flag.m4 +73 -0
- data/vendor/libsodium/m4/ax_check_gnu_make.m4 +78 -0
- data/vendor/libsodium/m4/ax_check_link_flag.m4 +72 -0
- data/vendor/libsodium/m4/ld-output-def.m4 +29 -0
- data/vendor/libsodium/m4/pkg.m4 +214 -0
- data/vendor/libsodium/msvc-scripts/Makefile.am +4 -0
- data/vendor/libsodium/msvc-scripts/process.bat +8 -0
- data/vendor/libsodium/msvc-scripts/rep.vbs +12 -0
- data/vendor/libsodium/msvc-scripts/sodium.props +25 -0
- data/vendor/libsodium/src/Makefile.am +3 -0
- data/vendor/libsodium/src/libsodium/Makefile.am +232 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/crypto_auth.c +34 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/api.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/hmac_hmacsha256.c +83 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/verify_hmacsha256.c +9 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/api.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/hmac_hmacsha512256.c +86 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/verify_hmacsha512256.c +9 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/try.c +119 -0
- data/vendor/libsodium/src/libsodium/crypto_box/crypto_box.c +95 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305_api.c +41 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c +22 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/api.h +19 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +19 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c +27 -0
- data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +12 -0
- data/vendor/libsodium/src/libsodium/crypto_box/try.c +195 -0
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +108 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/core_salsa20_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +134 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/core_salsa2012_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +134 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/core_salsa208_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +134 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c +31 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/api.h +4 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2-impl.h +132 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +169 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +364 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c +355 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +61 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +84 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/crypto_hash.c +9 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256_api.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/ref/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/ref/hash_sha256.c +69 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512_api.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/ref/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/ref/hash_sha512.c +71 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/try.c +76 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/hashblocks_sha256_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/api.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/blocks_sha256.c +212 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/hashblocks_sha512_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/api.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/blocks_sha512.c +239 -0
- data/vendor/libsodium/src/libsodium/crypto_hashblocks/try.c +78 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c +34 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/auth_poly1305_53.c +1661 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/verify_poly1305_53.c +10 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c +151 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/portable-jane.h +772 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c +10 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +36 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c +152 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c +34 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/api.h +9 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/base_curve25519_donna_c64.c +13 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/smult_curve25519_donna_c64.c +426 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/base_curve25519_ref.c +20 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c +268 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c +14 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/try.c +125 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +48 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/try.c +129 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/api.h +12 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c +35 -0
- data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c +27 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +91 -0
- data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24_api.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +61 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/description +1 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +14 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/base.h +1344 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/base2.h +40 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d2.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe.h +56 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_0.c +19 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_1.c +19 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_add.c +57 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_cmov.c +63 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_copy.c +29 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_frombytes.c +73 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_invert.c +14 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnegative.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnonzero.c +19 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_mul.c +253 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_neg.c +45 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_pow22523.c +13 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq.c +149 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq2.c +160 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sub.c +57 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_tobytes.c +119 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +95 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.h +97 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +96 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_frombytes.c +50 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.h +88 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.h +88 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p2.c +12 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p3.c +13 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_0.c +8 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.h +73 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_0.c +9 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_dbl.c +12 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_cached.c +17 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_p2.c +12 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_tobytes.c +14 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_precomp_0.c +8 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_scalarmult_base.c +105 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.c +11 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.h +97 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_tobytes.c +14 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +31 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +40 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow22523.h +160 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow225521.h +160 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc.h +15 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_muladd.c +368 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_reduce.c +275 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +38 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sqrtm1.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519_api.c +26 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/api.h +13 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519.h +54 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519_edwards25519sha512batch.c +348 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519.h +34 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519_edwards25519sha512batch.c +230 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519.h +51 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c +146 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c +102 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c +21 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/try.c +87 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +159 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/api.h +14 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +59 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common.h +788 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common_aes128ctr.c +64 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts.h +28 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts_aes128ctr.c +14 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128.h +47 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128_aes128ctr.c +131 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +28 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/types.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +181 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr_api.c +21 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-be.h +274 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-le.h +274 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table.h +56 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c +238 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h +171 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/api.h +14 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h +27 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/stream_aes256estream_api.c +21 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c +36 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/api.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +950 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/api.h +8 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +55 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +58 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +51 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +54 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/api.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +51 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +54 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/try.c +122 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/api.h +11 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +24 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +25 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20_api.c +16 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/16/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/api.h +2 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c +24 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/16/verify_16_api.c +6 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/32/checksum +1 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/api.h +2 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c +40 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/32/verify_32_api.c +6 -0
- data/vendor/libsodium/src/libsodium/crypto_verify/try.c +76 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.am +63 -0
- data/vendor/libsodium/src/libsodium/include/sodium.h +48 -0
- data/vendor/libsodium/src/libsodium/include/sodium/core.h +18 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth.h +36 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +36 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +36 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +83 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +72 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h +40 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h +40 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h +40 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h +40 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash.h +70 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +87 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash.h +23 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +29 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h +29 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha256.h +32 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha512.h +32 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_int32.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_int64.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h +37 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +65 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_53.h +34 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h +34 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +36 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h.in +44 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +47 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +44 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash.h +33 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +29 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +61 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +52 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +44 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +46 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +60 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes256estream.h +61 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h.in +54 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +43 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +43 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +44 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint16.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint32.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint64.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint8.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_16.h +25 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_32.h +25 -0
- data/vendor/libsodium/src/libsodium/include/sodium/export.h +32 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +53 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +45 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h +45 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +36 -0
- data/vendor/libsodium/src/libsodium/include/sodium/version.h.in +29 -0
- data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +63 -0
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +317 -0
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +212 -0
- data/vendor/libsodium/src/libsodium/sodium/compat.c +248 -0
- data/vendor/libsodium/src/libsodium/sodium/core.c +21 -0
- data/vendor/libsodium/src/libsodium/sodium/utils.c +94 -0
- data/vendor/libsodium/src/libsodium/sodium/version.c +20 -0
- data/vendor/libsodium/test/Makefile.am +5 -0
- data/vendor/libsodium/test/default/Makefile.am +277 -0
- data/vendor/libsodium/test/default/auth.c +21 -0
- data/vendor/libsodium/test/default/auth.exp +4 -0
- data/vendor/libsodium/test/default/auth2.c +36 -0
- data/vendor/libsodium/test/default/auth2.exp +4 -0
- data/vendor/libsodium/test/default/auth3.c +36 -0
- data/vendor/libsodium/test/default/auth3.exp +1 -0
- data/vendor/libsodium/test/default/auth5.c +37 -0
- data/vendor/libsodium/test/default/auth5.exp +0 -0
- data/vendor/libsodium/test/default/box.c +65 -0
- data/vendor/libsodium/test/default/box.exp +19 -0
- data/vendor/libsodium/test/default/box2.c +66 -0
- data/vendor/libsodium/test/default/box2.exp +17 -0
- data/vendor/libsodium/test/default/box7.c +37 -0
- data/vendor/libsodium/test/default/box7.exp +0 -0
- data/vendor/libsodium/test/default/box8.c +44 -0
- data/vendor/libsodium/test/default/box8.exp +0 -0
- data/vendor/libsodium/test/default/cmptest.h +51 -0
- data/vendor/libsodium/test/default/core1.c +32 -0
- data/vendor/libsodium/test/default/core1.exp +4 -0
- data/vendor/libsodium/test/default/core2.c +35 -0
- data/vendor/libsodium/test/default/core2.exp +4 -0
- data/vendor/libsodium/test/default/core3.c +42 -0
- data/vendor/libsodium/test/default/core3.exp +1 -0
- data/vendor/libsodium/test/default/core4.c +35 -0
- data/vendor/libsodium/test/default/core4.exp +8 -0
- data/vendor/libsodium/test/default/core5.c +34 -0
- data/vendor/libsodium/test/default/core5.exp +4 -0
- data/vendor/libsodium/test/default/core6.c +49 -0
- data/vendor/libsodium/test/default/core6.exp +4 -0
- data/vendor/libsodium/test/default/generichash.c +27 -0
- data/vendor/libsodium/test/default/generichash.exp +64 -0
- data/vendor/libsodium/test/default/generichash2.c +31 -0
- data/vendor/libsodium/test/default/generichash2.exp +64 -0
- data/vendor/libsodium/test/default/hash.c +16 -0
- data/vendor/libsodium/test/default/hash.exp +1 -0
- data/vendor/libsodium/test/default/hash2.exp +1 -0
- data/vendor/libsodium/test/default/hash3.c +16 -0
- data/vendor/libsodium/test/default/hash3.exp +1 -0
- data/vendor/libsodium/test/default/onetimeauth.c +44 -0
- data/vendor/libsodium/test/default/onetimeauth.exp +2 -0
- data/vendor/libsodium/test/default/onetimeauth2.c +42 -0
- data/vendor/libsodium/test/default/onetimeauth2.exp +1 -0
- data/vendor/libsodium/test/default/onetimeauth7.c +37 -0
- data/vendor/libsodium/test/default/onetimeauth7.exp +0 -0
- data/vendor/libsodium/test/default/pre.js +33 -0
- data/vendor/libsodium/test/default/randombytes.c +16 -0
- data/vendor/libsodium/test/default/scalarmult.c +25 -0
- data/vendor/libsodium/test/default/scalarmult.exp +4 -0
- data/vendor/libsodium/test/default/scalarmult2.c +25 -0
- data/vendor/libsodium/test/default/scalarmult2.exp +4 -0
- data/vendor/libsodium/test/default/scalarmult5.c +32 -0
- data/vendor/libsodium/test/default/scalarmult5.exp +4 -0
- data/vendor/libsodium/test/default/scalarmult6.c +32 -0
- data/vendor/libsodium/test/default/scalarmult6.exp +4 -0
- data/vendor/libsodium/test/default/scalarmult7.c +34 -0
- data/vendor/libsodium/test/default/scalarmult7.exp +1 -0
- data/vendor/libsodium/test/default/scalarmult8.c +34 -0
- data/vendor/libsodium/test/default/scalarmult8.exp +1 -0
- data/vendor/libsodium/test/default/secretbox.c +58 -0
- data/vendor/libsodium/test/default/secretbox.exp +19 -0
- data/vendor/libsodium/test/default/secretbox2.c +59 -0
- data/vendor/libsodium/test/default/secretbox2.exp +17 -0
- data/vendor/libsodium/test/default/secretbox7.c +33 -0
- data/vendor/libsodium/test/default/secretbox7.exp +0 -0
- data/vendor/libsodium/test/default/secretbox8.c +40 -0
- data/vendor/libsodium/test/default/secretbox8.exp +0 -0
- data/vendor/libsodium/test/default/shorthash.c +23 -0
- data/vendor/libsodium/test/default/shorthash.exp +64 -0
- data/vendor/libsodium/test/default/sodium_core.c +11 -0
- data/vendor/libsodium/test/default/sodium_core.exp +1 -0
- data/vendor/libsodium/test/default/sodium_utils.c +27 -0
- data/vendor/libsodium/test/default/sodium_utils.exp +6 -0
- data/vendor/libsodium/test/default/sodium_version.c +13 -0
- data/vendor/libsodium/test/default/sodium_version.exp +3 -0
- data/vendor/libsodium/test/default/stream.c +30 -0
- data/vendor/libsodium/test/default/stream.exp +1 -0
- data/vendor/libsodium/test/default/stream2.c +28 -0
- data/vendor/libsodium/test/default/stream2.exp +1 -0
- data/vendor/libsodium/test/default/stream3.c +30 -0
- data/vendor/libsodium/test/default/stream3.exp +4 -0
- data/vendor/libsodium/test/default/stream4.c +55 -0
- data/vendor/libsodium/test/default/stream4.exp +17 -0
- data/vendor/libsodium/test/default/stream5.c +29 -0
- data/vendor/libsodium/test/default/stream5.exp +1 -0
- data/vendor/libsodium/test/default/stream6.c +54 -0
- data/vendor/libsodium/test/default/stream6.exp +17 -0
- data/vendor/libsodium/test/default/wintest.bat +56 -0
- data/vendor/libsodium/test/quirks/windows/windows-quirks.h +18 -0
- metadata +500 -0
@@ -0,0 +1,102 @@
|
|
1
|
+
#include "api.h"
|
2
|
+
#include "crypto_hash_sha512.h"
|
3
|
+
#include "randombytes.h"
|
4
|
+
#include "crypto_verify_32.h"
|
5
|
+
|
6
|
+
#include "ge25519.h"
|
7
|
+
|
8
|
+
int crypto_sign_keypair(
|
9
|
+
unsigned char *pk,
|
10
|
+
unsigned char *sk
|
11
|
+
)
|
12
|
+
{
|
13
|
+
sc25519 scsk;
|
14
|
+
ge25519 gepk;
|
15
|
+
|
16
|
+
randombytes(sk, 32);
|
17
|
+
crypto_hash_sha512(sk, sk, 32);
|
18
|
+
sk[0] &= 248;
|
19
|
+
sk[31] &= 127;
|
20
|
+
sk[31] |= 64;
|
21
|
+
|
22
|
+
sc25519_from32bytes(&scsk,sk);
|
23
|
+
|
24
|
+
ge25519_scalarmult_base(&gepk, &scsk);
|
25
|
+
ge25519_pack(pk, &gepk);
|
26
|
+
return 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
int crypto_sign(
|
30
|
+
unsigned char *sm,unsigned long long *smlen,
|
31
|
+
const unsigned char *m,unsigned long long mlen,
|
32
|
+
const unsigned char *sk
|
33
|
+
)
|
34
|
+
{
|
35
|
+
sc25519 sck, scs, scsk;
|
36
|
+
ge25519 ger;
|
37
|
+
unsigned char r[32];
|
38
|
+
unsigned char s[32];
|
39
|
+
unsigned long long i;
|
40
|
+
unsigned char hmg[crypto_hash_sha512_BYTES];
|
41
|
+
unsigned char hmr[crypto_hash_sha512_BYTES];
|
42
|
+
|
43
|
+
*smlen = mlen+64;
|
44
|
+
for(i=0;i<mlen;i++)
|
45
|
+
sm[32 + i] = m[i];
|
46
|
+
for(i=0;i<32;i++)
|
47
|
+
sm[i] = sk[32+i];
|
48
|
+
crypto_hash_sha512(hmg, sm, mlen+32); /* Generate k as h(m,sk[32],...,sk[63]) */
|
49
|
+
|
50
|
+
sc25519_from64bytes(&sck, hmg);
|
51
|
+
ge25519_scalarmult_base(&ger, &sck);
|
52
|
+
ge25519_pack(r, &ger);
|
53
|
+
|
54
|
+
for(i=0;i<32;i++)
|
55
|
+
sm[i] = r[i];
|
56
|
+
|
57
|
+
crypto_hash_sha512(hmr, sm, mlen+32); /* Compute h(m,r) */
|
58
|
+
sc25519_from64bytes(&scs, hmr);
|
59
|
+
sc25519_mul(&scs, &scs, &sck);
|
60
|
+
|
61
|
+
sc25519_from32bytes(&scsk, sk);
|
62
|
+
sc25519_add(&scs, &scs, &scsk);
|
63
|
+
|
64
|
+
sc25519_to32bytes(s,&scs); /* cat s */
|
65
|
+
for(i=0;i<32;i++)
|
66
|
+
sm[mlen+32+i] = s[i];
|
67
|
+
|
68
|
+
return 0;
|
69
|
+
}
|
70
|
+
|
71
|
+
int crypto_sign_open(
|
72
|
+
unsigned char *m,unsigned long long *mlen,
|
73
|
+
const unsigned char *sm,unsigned long long smlen,
|
74
|
+
const unsigned char *pk
|
75
|
+
)
|
76
|
+
{
|
77
|
+
unsigned long long i;
|
78
|
+
unsigned char t1[32], t2[32];
|
79
|
+
ge25519 get1, get2, gepk;
|
80
|
+
sc25519 schmr, scs;
|
81
|
+
unsigned char hmr[crypto_hash_sha512_BYTES];
|
82
|
+
|
83
|
+
if (ge25519_unpack_vartime(&get1, sm)) return -1;
|
84
|
+
if (ge25519_unpack_vartime(&gepk, pk)) return -1;
|
85
|
+
|
86
|
+
crypto_hash_sha512(hmr,sm,smlen-32);
|
87
|
+
|
88
|
+
sc25519_from64bytes(&schmr, hmr);
|
89
|
+
ge25519_scalarmult(&get1, &get1, &schmr);
|
90
|
+
ge25519_add(&get1, &get1, &gepk);
|
91
|
+
ge25519_pack(t1, &get1);
|
92
|
+
|
93
|
+
sc25519_from32bytes(&scs, &sm[smlen-32]);
|
94
|
+
ge25519_scalarmult_base(&get2, &scs);
|
95
|
+
ge25519_pack(t2, &get2);
|
96
|
+
|
97
|
+
for(i=0;i<smlen-64;i++)
|
98
|
+
m[i] = sm[i + 32];
|
99
|
+
*mlen = smlen-64;
|
100
|
+
|
101
|
+
return crypto_verify_32(t1, t2);
|
102
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#include "crypto_sign_edwards25519sha512batch.h"
|
2
|
+
|
3
|
+
size_t
|
4
|
+
crypto_sign_edwards25519sha512batch_bytes(void) {
|
5
|
+
return crypto_sign_edwards25519sha512batch_BYTES;
|
6
|
+
}
|
7
|
+
|
8
|
+
size_t
|
9
|
+
crypto_sign_edwards25519sha512batch_publickeybytes(void) {
|
10
|
+
return crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES;
|
11
|
+
}
|
12
|
+
|
13
|
+
size_t
|
14
|
+
crypto_sign_edwards25519sha512batch_secretkeybytes(void) {
|
15
|
+
return crypto_sign_edwards25519sha512batch_SECRETKEYBYTES;
|
16
|
+
}
|
17
|
+
|
18
|
+
const char *
|
19
|
+
crypto_sign_edwards25519sha512batch_primitive(void) {
|
20
|
+
return "edwards25519sha512batch";
|
21
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/*
|
2
|
+
* crypto_sign/try.c version 20090118
|
3
|
+
* D. J. Bernstein
|
4
|
+
* Public domain.
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include <stdlib.h>
|
8
|
+
#include "randombytes.h"
|
9
|
+
#include "crypto_sign.h"
|
10
|
+
#include "windows/windows-quirks.h"
|
11
|
+
|
12
|
+
#define MAXTEST_BYTES 10000
|
13
|
+
#define TUNE_BYTES 1536
|
14
|
+
|
15
|
+
extern unsigned char *alignedcalloc(unsigned long long);
|
16
|
+
|
17
|
+
const char *primitiveimplementation = crypto_sign_IMPLEMENTATION;
|
18
|
+
|
19
|
+
static unsigned char *pk;
|
20
|
+
static unsigned char *sk;
|
21
|
+
static unsigned char *m; unsigned long long mlen;
|
22
|
+
static unsigned char *sm; unsigned long long smlen;
|
23
|
+
static unsigned char *t; unsigned long long tlen;
|
24
|
+
|
25
|
+
void preallocate(void)
|
26
|
+
{
|
27
|
+
#ifdef RAND_R_PRNG_NOT_SEEDED
|
28
|
+
RAND_status();
|
29
|
+
#endif
|
30
|
+
}
|
31
|
+
|
32
|
+
void allocate(void)
|
33
|
+
{
|
34
|
+
pk = alignedcalloc(crypto_sign_PUBLICKEYBYTES);
|
35
|
+
sk = alignedcalloc(crypto_sign_SECRETKEYBYTES);
|
36
|
+
m = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES);
|
37
|
+
sm = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES);
|
38
|
+
t = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES);
|
39
|
+
}
|
40
|
+
|
41
|
+
void predoit(void)
|
42
|
+
{
|
43
|
+
crypto_sign_keypair(pk,sk);
|
44
|
+
mlen = TUNE_BYTES;
|
45
|
+
smlen = 0;
|
46
|
+
randombytes(m,mlen);
|
47
|
+
crypto_sign(sm,&smlen,m,mlen,sk);
|
48
|
+
}
|
49
|
+
|
50
|
+
void doit(void)
|
51
|
+
{
|
52
|
+
crypto_sign_open(t,&tlen,sm,smlen,pk);
|
53
|
+
}
|
54
|
+
|
55
|
+
char checksum[crypto_sign_BYTES * 2 + 1];
|
56
|
+
|
57
|
+
const char *checksum_compute(void)
|
58
|
+
{
|
59
|
+
long long mlen;
|
60
|
+
long long i;
|
61
|
+
long long j;
|
62
|
+
|
63
|
+
if (crypto_sign_keypair(pk,sk) != 0) return "crypto_sign_keypair returns nonzero";
|
64
|
+
for (mlen = 0;mlen < MAXTEST_BYTES;mlen += 1 + (mlen / 16)) {
|
65
|
+
if (crypto_sign(sm,&smlen,m,mlen,sk) != 0) return "crypto_sign returns nonzero";
|
66
|
+
if (crypto_sign_open(t,&tlen,sm,smlen,pk) != 0) return "crypto_sign_open returns nonzero";
|
67
|
+
if (tlen != mlen) return "crypto_sign_open does not match length";
|
68
|
+
for (i = 0;i < tlen;++i)
|
69
|
+
if (t[i] != m[i])
|
70
|
+
return "crypto_sign_open does not match contents";
|
71
|
+
|
72
|
+
j = rand() % smlen;
|
73
|
+
sm[j] ^= 1;
|
74
|
+
if (crypto_sign_open(t,&tlen,sm,smlen,pk) == 0) {
|
75
|
+
if (tlen != mlen) return "crypto_sign_open allows trivial forgery of length";
|
76
|
+
for (i = 0;i < tlen;++i)
|
77
|
+
if (t[i] != m[i])
|
78
|
+
return "crypto_sign_open allows trivial forgery of contents";
|
79
|
+
}
|
80
|
+
sm[j] ^= 1;
|
81
|
+
|
82
|
+
}
|
83
|
+
|
84
|
+
/* do some long-term checksum */
|
85
|
+
checksum[0] = 0;
|
86
|
+
return 0;
|
87
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
6e9966897837aae181e93261ae88fdf0
|
@@ -0,0 +1,159 @@
|
|
1
|
+
/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper
|
2
|
+
* Date: 2009-03-19
|
3
|
+
* Public domain */
|
4
|
+
|
5
|
+
#include "api.h"
|
6
|
+
#include "int128.h"
|
7
|
+
#include "common.h"
|
8
|
+
#include "consts.h"
|
9
|
+
|
10
|
+
int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const unsigned char *noncep, const unsigned char *c)
|
11
|
+
{
|
12
|
+
|
13
|
+
int128 xmm0;
|
14
|
+
int128 xmm1;
|
15
|
+
int128 xmm2;
|
16
|
+
int128 xmm3;
|
17
|
+
int128 xmm4;
|
18
|
+
int128 xmm5;
|
19
|
+
int128 xmm6;
|
20
|
+
int128 xmm7;
|
21
|
+
|
22
|
+
int128 xmm8;
|
23
|
+
int128 xmm9;
|
24
|
+
int128 xmm10;
|
25
|
+
int128 xmm11;
|
26
|
+
int128 xmm12;
|
27
|
+
int128 xmm13;
|
28
|
+
int128 xmm14;
|
29
|
+
int128 xmm15;
|
30
|
+
|
31
|
+
int128 nonce_stack;
|
32
|
+
unsigned long long lensav;
|
33
|
+
unsigned char bl[128];
|
34
|
+
unsigned char *blp;
|
35
|
+
unsigned char *np;
|
36
|
+
unsigned char b;
|
37
|
+
|
38
|
+
uint32 tmp;
|
39
|
+
|
40
|
+
/* Copy nonce on the stack */
|
41
|
+
copy2(&nonce_stack, (const int128 *) (noncep + 0));
|
42
|
+
np = (unsigned char *)&nonce_stack;
|
43
|
+
|
44
|
+
enc_block:
|
45
|
+
|
46
|
+
xmm0 = *(int128 *) (np + 0);
|
47
|
+
copy2(&xmm1, &xmm0);
|
48
|
+
shufb(&xmm1, SWAP32);
|
49
|
+
copy2(&xmm2, &xmm1);
|
50
|
+
copy2(&xmm3, &xmm1);
|
51
|
+
copy2(&xmm4, &xmm1);
|
52
|
+
copy2(&xmm5, &xmm1);
|
53
|
+
copy2(&xmm6, &xmm1);
|
54
|
+
copy2(&xmm7, &xmm1);
|
55
|
+
|
56
|
+
add_uint32_big(&xmm1, 1);
|
57
|
+
add_uint32_big(&xmm2, 2);
|
58
|
+
add_uint32_big(&xmm3, 3);
|
59
|
+
add_uint32_big(&xmm4, 4);
|
60
|
+
add_uint32_big(&xmm5, 5);
|
61
|
+
add_uint32_big(&xmm6, 6);
|
62
|
+
add_uint32_big(&xmm7, 7);
|
63
|
+
|
64
|
+
shufb(&xmm0, M0);
|
65
|
+
shufb(&xmm1, M0SWAP);
|
66
|
+
shufb(&xmm2, M0SWAP);
|
67
|
+
shufb(&xmm3, M0SWAP);
|
68
|
+
shufb(&xmm4, M0SWAP);
|
69
|
+
shufb(&xmm5, M0SWAP);
|
70
|
+
shufb(&xmm6, M0SWAP);
|
71
|
+
shufb(&xmm7, M0SWAP);
|
72
|
+
|
73
|
+
bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, xmm8)
|
74
|
+
|
75
|
+
aesround( 1, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
76
|
+
aesround( 2, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
|
77
|
+
aesround( 3, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
78
|
+
aesround( 4, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
|
79
|
+
aesround( 5, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
80
|
+
aesround( 6, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
|
81
|
+
aesround( 7, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
82
|
+
aesround( 8, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
|
83
|
+
aesround( 9, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
84
|
+
lastround(xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
|
85
|
+
|
86
|
+
bitslice(xmm13, xmm10, xmm15, xmm11, xmm14, xmm12, xmm9, xmm8, xmm0)
|
87
|
+
|
88
|
+
if(len < 128) goto partial;
|
89
|
+
if(len == 128) goto full;
|
90
|
+
|
91
|
+
tmp = load32_bigendian(np + 12);
|
92
|
+
tmp += 8;
|
93
|
+
store32_bigendian(np + 12, tmp);
|
94
|
+
|
95
|
+
*(int128 *) (outp + 0) = xmm8;
|
96
|
+
*(int128 *) (outp + 16) = xmm9;
|
97
|
+
*(int128 *) (outp + 32) = xmm12;
|
98
|
+
*(int128 *) (outp + 48) = xmm14;
|
99
|
+
*(int128 *) (outp + 64) = xmm11;
|
100
|
+
*(int128 *) (outp + 80) = xmm15;
|
101
|
+
*(int128 *) (outp + 96) = xmm10;
|
102
|
+
*(int128 *) (outp + 112) = xmm13;
|
103
|
+
|
104
|
+
len -= 128;
|
105
|
+
outp += 128;
|
106
|
+
|
107
|
+
goto enc_block;
|
108
|
+
|
109
|
+
partial:
|
110
|
+
|
111
|
+
lensav = len;
|
112
|
+
len >>= 4;
|
113
|
+
|
114
|
+
tmp = load32_bigendian(np + 12);
|
115
|
+
tmp += len;
|
116
|
+
store32_bigendian(np + 12, tmp);
|
117
|
+
|
118
|
+
blp = bl;
|
119
|
+
*(int128 *)(blp + 0) = xmm8;
|
120
|
+
*(int128 *)(blp + 16) = xmm9;
|
121
|
+
*(int128 *)(blp + 32) = xmm12;
|
122
|
+
*(int128 *)(blp + 48) = xmm14;
|
123
|
+
*(int128 *)(blp + 64) = xmm11;
|
124
|
+
*(int128 *)(blp + 80) = xmm15;
|
125
|
+
*(int128 *)(blp + 96) = xmm10;
|
126
|
+
*(int128 *)(blp + 112) = xmm13;
|
127
|
+
|
128
|
+
bytes:
|
129
|
+
|
130
|
+
if(lensav == 0) goto end;
|
131
|
+
|
132
|
+
b = blp[0]; /* clang false positive */
|
133
|
+
*(unsigned char *)(outp + 0) = b;
|
134
|
+
|
135
|
+
blp += 1;
|
136
|
+
outp +=1;
|
137
|
+
lensav -= 1;
|
138
|
+
|
139
|
+
goto bytes;
|
140
|
+
|
141
|
+
full:
|
142
|
+
|
143
|
+
tmp = load32_bigendian(np + 12);
|
144
|
+
tmp += 8;
|
145
|
+
store32_bigendian(np + 12, tmp);
|
146
|
+
|
147
|
+
*(int128 *) (outp + 0) = xmm8;
|
148
|
+
*(int128 *) (outp + 16) = xmm9;
|
149
|
+
*(int128 *) (outp + 32) = xmm12;
|
150
|
+
*(int128 *) (outp + 48) = xmm14;
|
151
|
+
*(int128 *) (outp + 64) = xmm11;
|
152
|
+
*(int128 *) (outp + 80) = xmm15;
|
153
|
+
*(int128 *) (outp + 96) = xmm10;
|
154
|
+
*(int128 *) (outp + 112) = xmm13;
|
155
|
+
|
156
|
+
end:
|
157
|
+
return 0;
|
158
|
+
|
159
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
#include "crypto_stream_aes128ctr.h"
|
3
|
+
|
4
|
+
#define crypto_stream crypto_stream_aes128ctr
|
5
|
+
#define crypto_stream_xor crypto_stream_aes128ctr_xor
|
6
|
+
#define crypto_stream_beforenm crypto_stream_aes128ctr_beforenm
|
7
|
+
#define crypto_stream_afternm crypto_stream_aes128ctr_afternm
|
8
|
+
#define crypto_stream_xor_afternm crypto_stream_aes128ctr_xor_afternm
|
9
|
+
#define crypto_stream_KEYBYTES crypto_stream_aes128ctr_KEYBYTES
|
10
|
+
#define crypto_stream_NONCEBYTES crypto_stream_aes128ctr_NONCEBYTES
|
11
|
+
#define crypto_stream_BEFORENMBYTES crypto_stream_aes128ctr_BEFORENMBYTES
|
12
|
+
#define crypto_stream_PRIMITIVE "aes128ctr"
|
13
|
+
#define crypto_stream_IMPLEMENTATION crypto_stream_aes128ctr_IMPLEMENTATION
|
14
|
+
#define crypto_stream_VERSION crypto_stream_aes128ctr_VERSION
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper
|
2
|
+
* Date: 2009-03-19
|
3
|
+
* Public domain */
|
4
|
+
|
5
|
+
#include "api.h"
|
6
|
+
#include "consts.h"
|
7
|
+
#include "int128.h"
|
8
|
+
#include "common.h"
|
9
|
+
|
10
|
+
int crypto_stream_beforenm(unsigned char *c, const unsigned char *k)
|
11
|
+
{
|
12
|
+
|
13
|
+
/*
|
14
|
+
int64 x0;
|
15
|
+
int64 x1;
|
16
|
+
int64 x2;
|
17
|
+
int64 x3;
|
18
|
+
int64 e;
|
19
|
+
int64 q0;
|
20
|
+
int64 q1;
|
21
|
+
int64 q2;
|
22
|
+
int64 q3;
|
23
|
+
*/
|
24
|
+
|
25
|
+
int128 xmm0;
|
26
|
+
int128 xmm1;
|
27
|
+
int128 xmm2;
|
28
|
+
int128 xmm3;
|
29
|
+
int128 xmm4;
|
30
|
+
int128 xmm5;
|
31
|
+
int128 xmm6;
|
32
|
+
int128 xmm7;
|
33
|
+
int128 xmm8;
|
34
|
+
int128 xmm9;
|
35
|
+
int128 xmm10;
|
36
|
+
int128 xmm11;
|
37
|
+
int128 xmm12;
|
38
|
+
int128 xmm13;
|
39
|
+
int128 xmm14;
|
40
|
+
int128 xmm15;
|
41
|
+
int128 t;
|
42
|
+
|
43
|
+
bitslicekey0(k, c)
|
44
|
+
|
45
|
+
keyexpbs1(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
46
|
+
keyexpbs(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm1);, 2,c)
|
47
|
+
keyexpbs(xmm0, xmm1, xmm3, xmm2, xmm6, xmm5, xmm4, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm6);, 3,c)
|
48
|
+
keyexpbs(xmm0, xmm1, xmm6, xmm4, xmm2, xmm7, xmm3, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 4,c)
|
49
|
+
|
50
|
+
keyexpbs(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 5,c)
|
51
|
+
keyexpbs(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm5);, 6,c)
|
52
|
+
keyexpbs(xmm0, xmm1, xmm3, xmm2, xmm6, xmm5, xmm4, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 7,c)
|
53
|
+
keyexpbs(xmm0, xmm1, xmm6, xmm4, xmm2, xmm7, xmm3, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm7);, 8,c)
|
54
|
+
|
55
|
+
keyexpbs(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm0); xor_rcon(&xmm1); xor_rcon(&xmm6); xor_rcon(&xmm3);, 9,c)
|
56
|
+
keyexpbs10(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
|
57
|
+
|
58
|
+
return 0;
|
59
|
+
}
|