ganach-cli 6.12.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ganach-cli might be problematic. Click here for more details.
- package/LICENSE +22 -0
- package/README.md +381 -0
- package/cli.js +245 -0
- package/node_modules/@types/bn.js/LICENSE +21 -0
- package/node_modules/@types/bn.js/README.md +16 -0
- package/node_modules/@types/bn.js/index.d.ts +586 -0
- package/node_modules/@types/bn.js/package.json +40 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/node/assert.d.ts +84 -0
- package/node_modules/@types/node/async_hooks.d.ts +226 -0
- package/node_modules/@types/node/base.d.ts +20 -0
- package/node_modules/@types/node/buffer.d.ts +22 -0
- package/node_modules/@types/node/child_process.d.ts +505 -0
- package/node_modules/@types/node/cluster.d.ts +262 -0
- package/node_modules/@types/node/console.d.ts +133 -0
- package/node_modules/@types/node/constants.d.ts +8 -0
- package/node_modules/@types/node/crypto.d.ts +707 -0
- package/node_modules/@types/node/dgram.d.ts +141 -0
- package/node_modules/@types/node/dns.d.ts +371 -0
- package/node_modules/@types/node/domain.d.ts +24 -0
- package/node_modules/@types/node/events.d.ts +83 -0
- package/node_modules/@types/node/fs/promises.d.ts +539 -0
- package/node_modules/@types/node/fs.d.ts +2156 -0
- package/node_modules/@types/node/globals.d.ts +606 -0
- package/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/node/http.d.ts +414 -0
- package/node_modules/@types/node/http2.d.ts +952 -0
- package/node_modules/@types/node/https.d.ts +37 -0
- package/node_modules/@types/node/index.d.ts +61 -0
- package/node_modules/@types/node/inspector.d.ts +3041 -0
- package/node_modules/@types/node/module.d.ts +52 -0
- package/node_modules/@types/node/net.d.ts +268 -0
- package/node_modules/@types/node/os.d.ts +239 -0
- package/node_modules/@types/node/package.json +255 -0
- package/node_modules/@types/node/path.d.ts +153 -0
- package/node_modules/@types/node/perf_hooks.d.ts +271 -0
- package/node_modules/@types/node/process.d.ts +406 -0
- package/node_modules/@types/node/punycode.d.ts +12 -0
- package/node_modules/@types/node/querystring.d.ts +28 -0
- package/node_modules/@types/node/readline.d.ts +171 -0
- package/node_modules/@types/node/repl.d.ts +387 -0
- package/node_modules/@types/node/stream.d.ts +351 -0
- package/node_modules/@types/node/string_decoder.d.ts +7 -0
- package/node_modules/@types/node/timers.d.ts +16 -0
- package/node_modules/@types/node/tls.d.ts +777 -0
- package/node_modules/@types/node/trace_events.d.ts +61 -0
- package/node_modules/@types/node/ts3.4/assert.d.ts +57 -0
- package/node_modules/@types/node/ts3.4/base.d.ts +56 -0
- package/node_modules/@types/node/ts3.4/globals.global.d.ts +1 -0
- package/node_modules/@types/node/ts3.4/index.d.ts +8 -0
- package/node_modules/@types/node/ts3.6/base.d.ts +23 -0
- package/node_modules/@types/node/ts3.6/index.d.ts +8 -0
- package/node_modules/@types/node/tty.d.ts +66 -0
- package/node_modules/@types/node/url.d.ts +110 -0
- package/node_modules/@types/node/util.d.ts +196 -0
- package/node_modules/@types/node/v8.d.ts +187 -0
- package/node_modules/@types/node/vm.d.ts +146 -0
- package/node_modules/@types/node/wasi.d.ts +52 -0
- package/node_modules/@types/node/worker_threads.d.ts +192 -0
- package/node_modules/@types/node/zlib.d.ts +352 -0
- package/node_modules/@types/pbkdf2/LICENSE +21 -0
- package/node_modules/@types/pbkdf2/README.md +16 -0
- package/node_modules/@types/pbkdf2/index.d.ts +41 -0
- package/node_modules/@types/pbkdf2/package.json +30 -0
- package/node_modules/@types/secp256k1/LICENSE +21 -0
- package/node_modules/@types/secp256k1/README.md +16 -0
- package/node_modules/@types/secp256k1/index.d.ts +141 -0
- package/node_modules/@types/secp256k1/package.json +30 -0
- package/node_modules/ansi-regex/index.js +14 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +57 -0
- package/node_modules/ansi-regex/readme.md +87 -0
- package/node_modules/ansi-styles/index.js +165 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +60 -0
- package/node_modules/ansi-styles/readme.md +147 -0
- package/node_modules/base-x/LICENSE.md +22 -0
- package/node_modules/base-x/README.md +67 -0
- package/node_modules/base-x/package.json +53 -0
- package/node_modules/base-x/src/index.d.ts +10 -0
- package/node_modules/base-x/src/index.js +123 -0
- package/node_modules/blakejs/.npmignore +1 -0
- package/node_modules/blakejs/.travis.yml +3 -0
- package/node_modules/blakejs/README.md +112 -0
- package/node_modules/blakejs/blake2b.js +273 -0
- package/node_modules/blakejs/blake2s.js +190 -0
- package/node_modules/blakejs/generated_test_vectors.txt +100 -0
- package/node_modules/blakejs/index.js +15 -0
- package/node_modules/blakejs/package.json +27 -0
- package/node_modules/blakejs/test_blake2b.js +88 -0
- package/node_modules/blakejs/test_blake2s.js +80 -0
- package/node_modules/blakejs/util.js +81 -0
- package/node_modules/bn.js/README.md +221 -0
- package/node_modules/bn.js/lib/bn.js +3433 -0
- package/node_modules/bn.js/package.json +40 -0
- package/node_modules/bn.js/util/genCombMulTo.js +65 -0
- package/node_modules/bn.js/util/genCombMulTo10.js +65 -0
- package/node_modules/brorand/.npmignore +2 -0
- package/node_modules/brorand/README.md +26 -0
- package/node_modules/brorand/index.js +65 -0
- package/node_modules/brorand/package.json +35 -0
- package/node_modules/brorand/test/api-test.js +8 -0
- package/node_modules/browserify-aes/.travis.yml +15 -0
- package/node_modules/browserify-aes/LICENSE +21 -0
- package/node_modules/browserify-aes/README.md +19 -0
- package/node_modules/browserify-aes/aes.js +228 -0
- package/node_modules/browserify-aes/authCipher.js +117 -0
- package/node_modules/browserify-aes/browser.js +13 -0
- package/node_modules/browserify-aes/decrypter.js +124 -0
- package/node_modules/browserify-aes/encrypter.js +114 -0
- package/node_modules/browserify-aes/ghash.js +89 -0
- package/node_modules/browserify-aes/incr32.js +15 -0
- package/node_modules/browserify-aes/index.js +7 -0
- package/node_modules/browserify-aes/modes/cbc.js +17 -0
- package/node_modules/browserify-aes/modes/cfb.js +33 -0
- package/node_modules/browserify-aes/modes/cfb1.js +42 -0
- package/node_modules/browserify-aes/modes/cfb8.js +25 -0
- package/node_modules/browserify-aes/modes/ctr.js +30 -0
- package/node_modules/browserify-aes/modes/ecb.js +7 -0
- package/node_modules/browserify-aes/modes/index.js +18 -0
- package/node_modules/browserify-aes/modes/list.json +191 -0
- package/node_modules/browserify-aes/modes/ofb.js +16 -0
- package/node_modules/browserify-aes/package.json +47 -0
- package/node_modules/browserify-aes/streamCipher.js +27 -0
- package/node_modules/bs58/README.md +71 -0
- package/node_modules/bs58/index.js +4 -0
- package/node_modules/bs58/package.json +41 -0
- package/node_modules/bs58check/LICENSE +21 -0
- package/node_modules/bs58check/README.md +27 -0
- package/node_modules/bs58check/base.js +50 -0
- package/node_modules/bs58check/index.js +12 -0
- package/node_modules/bs58check/package.json +56 -0
- package/node_modules/buffer-from/LICENSE +21 -0
- package/node_modules/buffer-from/index.js +69 -0
- package/node_modules/buffer-from/package.json +23 -0
- package/node_modules/buffer-from/readme.md +69 -0
- package/node_modules/buffer-xor/.npmignore +1 -0
- package/node_modules/buffer-xor/.travis.yml +9 -0
- package/node_modules/buffer-xor/LICENSE +21 -0
- package/node_modules/buffer-xor/README.md +41 -0
- package/node_modules/buffer-xor/index.js +10 -0
- package/node_modules/buffer-xor/inline.js +1 -0
- package/node_modules/buffer-xor/inplace.js +9 -0
- package/node_modules/buffer-xor/package.json +41 -0
- package/node_modules/buffer-xor/test/fixtures.json +23 -0
- package/node_modules/buffer-xor/test/index.js +38 -0
- package/node_modules/camelcase/index.d.ts +63 -0
- package/node_modules/camelcase/index.js +76 -0
- package/node_modules/camelcase/license +9 -0
- package/node_modules/camelcase/package.json +47 -0
- package/node_modules/camelcase/readme.md +99 -0
- package/node_modules/cipher-base/.eslintrc +3 -0
- package/node_modules/cipher-base/.npmignore +1 -0
- package/node_modules/cipher-base/.travis.yml +6 -0
- package/node_modules/cipher-base/LICENSE +21 -0
- package/node_modules/cipher-base/README.md +17 -0
- package/node_modules/cipher-base/index.js +99 -0
- package/node_modules/cipher-base/package.json +36 -0
- package/node_modules/cipher-base/test.js +111 -0
- package/node_modules/cliui/LICENSE.txt +14 -0
- package/node_modules/cliui/README.md +115 -0
- package/node_modules/cliui/index.js +324 -0
- package/node_modules/cliui/package.json +71 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +868 -0
- package/node_modules/color-convert/index.js +78 -0
- package/node_modules/color-convert/package.json +50 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/.eslintrc.json +43 -0
- package/node_modules/color-name/.npmignore +107 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +29 -0
- package/node_modules/color-name/test.js +7 -0
- package/node_modules/create-hash/.travis.yml +17 -0
- package/node_modules/create-hash/LICENSE +21 -0
- package/node_modules/create-hash/README.md +19 -0
- package/node_modules/create-hash/browser.js +30 -0
- package/node_modules/create-hash/index.js +1 -0
- package/node_modules/create-hash/md5.js +5 -0
- package/node_modules/create-hash/package.json +43 -0
- package/node_modules/create-hash/test.js +41 -0
- package/node_modules/create-hmac/LICENSE +21 -0
- package/node_modules/create-hmac/README.md +20 -0
- package/node_modules/create-hmac/browser.js +62 -0
- package/node_modules/create-hmac/index.js +1 -0
- package/node_modules/create-hmac/legacy.js +46 -0
- package/node_modules/create-hmac/package.json +49 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +94 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +125 -0
- package/node_modules/cross-spawn/lib/util/escape.js +45 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +47 -0
- package/node_modules/cross-spawn/package.json +80 -0
- package/node_modules/decamelize/index.js +13 -0
- package/node_modules/decamelize/license +21 -0
- package/node_modules/decamelize/package.json +42 -0
- package/node_modules/decamelize/readme.md +48 -0
- package/node_modules/elliptic/README.md +238 -0
- package/node_modules/elliptic/lib/elliptic/curve/base.js +376 -0
- package/node_modules/elliptic/lib/elliptic/curve/edwards.js +432 -0
- package/node_modules/elliptic/lib/elliptic/curve/index.js +8 -0
- package/node_modules/elliptic/lib/elliptic/curve/mont.js +178 -0
- package/node_modules/elliptic/lib/elliptic/curve/short.js +937 -0
- package/node_modules/elliptic/lib/elliptic/curves.js +206 -0
- package/node_modules/elliptic/lib/elliptic/ec/index.js +241 -0
- package/node_modules/elliptic/lib/elliptic/ec/key.js +118 -0
- package/node_modules/elliptic/lib/elliptic/ec/signature.js +166 -0
- package/node_modules/elliptic/lib/elliptic/eddsa/index.js +118 -0
- package/node_modules/elliptic/lib/elliptic/eddsa/key.js +95 -0
- package/node_modules/elliptic/lib/elliptic/eddsa/signature.js +65 -0
- package/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js +780 -0
- package/node_modules/elliptic/lib/elliptic/utils.js +119 -0
- package/node_modules/elliptic/lib/elliptic.js +13 -0
- package/node_modules/elliptic/package.json +62 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +5 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +55 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +41 -0
- package/node_modules/ethereum-cryptography/LICENSE +26 -0
- package/node_modules/ethereum-cryptography/README.md +560 -0
- package/node_modules/ethereum-cryptography/aes.d.ts +4 -0
- package/node_modules/ethereum-cryptography/aes.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/aes.js +38 -0
- package/node_modules/ethereum-cryptography/aes.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/index.d.ts +8 -0
- package/node_modules/ethereum-cryptography/bip39/index.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/index.js +71 -0
- package/node_modules/ethereum-cryptography/bip39/index.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/czech.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/czech.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/czech.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/czech.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/english.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/english.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/english.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/english.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/french.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/french.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/french.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/french.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/italian.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/italian.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/italian.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/italian.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/japanese.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/japanese.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/japanese.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/japanese.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/korean.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/korean.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/korean.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/korean.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/simplified-chinese.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/simplified-chinese.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/simplified-chinese.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/simplified-chinese.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/spanish.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/spanish.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/spanish.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/spanish.js.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/traditional-chinese.d.ts +2 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/traditional-chinese.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/traditional-chinese.js +2053 -0
- package/node_modules/ethereum-cryptography/bip39/wordlists/traditional-chinese.js.map +1 -0
- package/node_modules/ethereum-cryptography/blake2b.d.ts +3 -0
- package/node_modules/ethereum-cryptography/blake2b.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/blake2b.js +12 -0
- package/node_modules/ethereum-cryptography/blake2b.js.map +1 -0
- package/node_modules/ethereum-cryptography/hash-utils.d.ts +4 -0
- package/node_modules/ethereum-cryptography/hash-utils.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/hash-utils.js +11 -0
- package/node_modules/ethereum-cryptography/hash-utils.js.map +1 -0
- package/node_modules/ethereum-cryptography/hdkey.d.ts +3 -0
- package/node_modules/ethereum-cryptography/hdkey.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/hdkey.js +5 -0
- package/node_modules/ethereum-cryptography/hdkey.js.map +1 -0
- package/node_modules/ethereum-cryptography/index.d.ts +1 -0
- package/node_modules/ethereum-cryptography/index.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/index.js +3 -0
- package/node_modules/ethereum-cryptography/index.js.map +1 -0
- package/node_modules/ethereum-cryptography/keccak.d.ts +6 -0
- package/node_modules/ethereum-cryptography/keccak.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/keccak.js +17 -0
- package/node_modules/ethereum-cryptography/keccak.js.map +1 -0
- package/node_modules/ethereum-cryptography/package.json +131 -0
- package/node_modules/ethereum-cryptography/pbkdf2.d.ts +4 -0
- package/node_modules/ethereum-cryptography/pbkdf2.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pbkdf2.js +27 -0
- package/node_modules/ethereum-cryptography/pbkdf2.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/hdkey.d.ts +37 -0
- package/node_modules/ethereum-cryptography/pure/hdkey.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pure/hdkey.js +5 -0
- package/node_modules/ethereum-cryptography/pure/hdkey.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/ripemd160.d.ts +3 -0
- package/node_modules/ethereum-cryptography/pure/ripemd160.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pure/ripemd160.js +6 -0
- package/node_modules/ethereum-cryptography/pure/ripemd160.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/sha256.d.ts +3 -0
- package/node_modules/ethereum-cryptography/pure/sha256.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pure/sha256.js +6 -0
- package/node_modules/ethereum-cryptography/pure/sha256.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-crypto.d.ts +13 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-crypto.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-crypto.js +37 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-crypto.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-secp256k1v3.d.ts +2 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-secp256k1v3.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-secp256k1v3.js +7 -0
- package/node_modules/ethereum-cryptography/pure/shims/hdkey-secp256k1v3.js.map +1 -0
- package/node_modules/ethereum-cryptography/pure/vendor/hdkey-without-crypto.js +255 -0
- package/node_modules/ethereum-cryptography/random.d.ts +4 -0
- package/node_modules/ethereum-cryptography/random.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/random.js +20 -0
- package/node_modules/ethereum-cryptography/random.js.map +1 -0
- package/node_modules/ethereum-cryptography/ripemd160.d.ts +3 -0
- package/node_modules/ethereum-cryptography/ripemd160.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/ripemd160.js +11 -0
- package/node_modules/ethereum-cryptography/ripemd160.js.map +1 -0
- package/node_modules/ethereum-cryptography/scrypt.d.ts +5 -0
- package/node_modules/ethereum-cryptography/scrypt.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/scrypt.js +59 -0
- package/node_modules/ethereum-cryptography/scrypt.js.map +1 -0
- package/node_modules/ethereum-cryptography/secp256k1.d.ts +4 -0
- package/node_modules/ethereum-cryptography/secp256k1.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/secp256k1.js +75 -0
- package/node_modules/ethereum-cryptography/secp256k1.js.map +1 -0
- package/node_modules/ethereum-cryptography/sha256.d.ts +3 -0
- package/node_modules/ethereum-cryptography/sha256.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/sha256.js +9 -0
- package/node_modules/ethereum-cryptography/sha256.js.map +1 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-crypto.d.ts +2 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-crypto.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-crypto.js +7 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-crypto.js.map +1 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-secp256k1v3.d.ts +13 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-secp256k1v3.d.ts.map +1 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-secp256k1v3.js +47 -0
- package/node_modules/ethereum-cryptography/shims/hdkey-secp256k1v3.js.map +1 -0
- package/node_modules/ethereum-cryptography/src/aes.ts +52 -0
- package/node_modules/ethereum-cryptography/src/bip39/index.ts +40 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/czech.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/english.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/french.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/italian.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/japanese.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/korean.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/simplified-chinese.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/spanish.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/bip39/wordlists/traditional-chinese.ts +2050 -0
- package/node_modules/ethereum-cryptography/src/blake2b.ts +9 -0
- package/node_modules/ethereum-cryptography/src/hash-utils.ts +11 -0
- package/node_modules/ethereum-cryptography/src/hdkey.ts +5 -0
- package/node_modules/ethereum-cryptography/src/index.ts +3 -0
- package/node_modules/ethereum-cryptography/src/keccak.ts +19 -0
- package/node_modules/ethereum-cryptography/src/pbkdf2.ts +37 -0
- package/node_modules/ethereum-cryptography/src/pure/hdkey.ts +36 -0
- package/node_modules/ethereum-cryptography/src/pure/ripemd160.ts +5 -0
- package/node_modules/ethereum-cryptography/src/pure/sha256.ts +5 -0
- package/node_modules/ethereum-cryptography/src/pure/shims/hdkey-crypto.ts +42 -0
- package/node_modules/ethereum-cryptography/src/pure/shims/hdkey-secp256k1v3.ts +1 -0
- package/node_modules/ethereum-cryptography/src/pure/vendor/hdkey-without-crypto.js +255 -0
- package/node_modules/ethereum-cryptography/src/random.ts +18 -0
- package/node_modules/ethereum-cryptography/src/ripemd160.ts +7 -0
- package/node_modules/ethereum-cryptography/src/scrypt.ts +24 -0
- package/node_modules/ethereum-cryptography/src/secp256k1.ts +24 -0
- package/node_modules/ethereum-cryptography/src/sha256.ts +5 -0
- package/node_modules/ethereum-cryptography/src/shims/hdkey-crypto.ts +1 -0
- package/node_modules/ethereum-cryptography/src/shims/hdkey-secp256k1v3.ts +49 -0
- package/node_modules/ethereum-cryptography/src/vendor/bip39-without-wordlists.js +206 -0
- package/node_modules/ethereum-cryptography/src/vendor/hdkey-without-crypto.js +255 -0
- package/node_modules/ethereum-cryptography/vendor/bip39-without-wordlists.js +206 -0
- package/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js +255 -0
- package/node_modules/ethereumjs-util/LICENSE +373 -0
- package/node_modules/ethereumjs-util/README.md +32 -0
- package/node_modules/ethereumjs-util/dist/account.d.ts +80 -0
- package/node_modules/ethereumjs-util/dist/account.js +168 -0
- package/node_modules/ethereumjs-util/dist/account.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/bytes.d.ts +68 -0
- package/node_modules/ethereumjs-util/dist/bytes.js +158 -0
- package/node_modules/ethereumjs-util/dist/bytes.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/constants.d.ts +34 -0
- package/node_modules/ethereumjs-util/dist/constants.js +37 -0
- package/node_modules/ethereumjs-util/dist/constants.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/hash.d.ts +30 -0
- package/node_modules/ethereumjs-util/dist/hash.js +84 -0
- package/node_modules/ethereumjs-util/dist/hash.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/index.d.ts +39 -0
- package/node_modules/ethereumjs-util/dist/index.js +46 -0
- package/node_modules/ethereumjs-util/dist/index.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/object.d.ts +12 -0
- package/node_modules/ethereumjs-util/dist/object.js +106 -0
- package/node_modules/ethereumjs-util/dist/object.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-adapter.d.ts +178 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-adapter.js +300 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-adapter.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/der.d.ts +1 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/der.js +634 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/der.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/index.d.ts +5 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/index.js +61 -0
- package/node_modules/ethereumjs-util/dist/secp256k1v3-lib/index.js.map +1 -0
- package/node_modules/ethereumjs-util/dist/signature.d.ts +37 -0
- package/node_modules/ethereumjs-util/dist/signature.js +107 -0
- package/node_modules/ethereumjs-util/dist/signature.js.map +1 -0
- package/node_modules/ethereumjs-util/package.json +131 -0
- package/node_modules/ethjs-util/LICENSE +21 -0
- package/node_modules/ethjs-util/README.md +143 -0
- package/node_modules/ethjs-util/dist/ethjs-util.js +2420 -0
- package/node_modules/ethjs-util/dist/ethjs-util.js.map +1 -0
- package/node_modules/ethjs-util/dist/ethjs-util.min.js +1 -0
- package/node_modules/ethjs-util/internals/webpack/webpack.config.js +58 -0
- package/node_modules/ethjs-util/lib/index.js +220 -0
- package/node_modules/ethjs-util/lib/tests/test.index.js +357 -0
- package/node_modules/ethjs-util/package.json +229 -0
- package/node_modules/ethjs-util/src/index.js +203 -0
- package/node_modules/ethjs-util/src/tests/test.index.js +382 -0
- package/node_modules/evp_bytestokey/LICENSE +21 -0
- package/node_modules/evp_bytestokey/README.md +51 -0
- package/node_modules/evp_bytestokey/index.js +45 -0
- package/node_modules/evp_bytestokey/package.json +49 -0
- package/node_modules/execa/index.js +361 -0
- package/node_modules/execa/lib/errname.js +39 -0
- package/node_modules/execa/lib/stdio.js +41 -0
- package/node_modules/execa/license +9 -0
- package/node_modules/execa/package.json +73 -0
- package/node_modules/execa/readme.md +327 -0
- package/node_modules/find-up/index.js +46 -0
- package/node_modules/find-up/license +9 -0
- package/node_modules/find-up/package.json +54 -0
- package/node_modules/find-up/readme.md +87 -0
- package/node_modules/get-caller-file/LICENSE.md +6 -0
- package/node_modules/get-caller-file/README.md +41 -0
- package/node_modules/get-caller-file/index.d.ts +2 -0
- package/node_modules/get-caller-file/index.js +22 -0
- package/node_modules/get-caller-file/index.js.map +1 -0
- package/node_modules/get-caller-file/package.json +46 -0
- package/node_modules/get-stream/buffer-stream.js +51 -0
- package/node_modules/get-stream/index.js +50 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +50 -0
- package/node_modules/get-stream/readme.md +123 -0
- package/node_modules/hash-base/LICENSE +21 -0
- package/node_modules/hash-base/README.md +48 -0
- package/node_modules/hash-base/index.js +95 -0
- package/node_modules/hash-base/package.json +46 -0
- package/node_modules/hash.js/.eslintrc.js +41 -0
- package/node_modules/hash.js/.travis.yml +10 -0
- package/node_modules/hash.js/README.md +48 -0
- package/node_modules/hash.js/lib/hash/common.js +92 -0
- package/node_modules/hash.js/lib/hash/hmac.js +47 -0
- package/node_modules/hash.js/lib/hash/ripemd.js +146 -0
- package/node_modules/hash.js/lib/hash/sha/1.js +74 -0
- package/node_modules/hash.js/lib/hash/sha/224.js +30 -0
- package/node_modules/hash.js/lib/hash/sha/256.js +105 -0
- package/node_modules/hash.js/lib/hash/sha/384.js +35 -0
- package/node_modules/hash.js/lib/hash/sha/512.js +330 -0
- package/node_modules/hash.js/lib/hash/sha/common.js +49 -0
- package/node_modules/hash.js/lib/hash/sha.js +7 -0
- package/node_modules/hash.js/lib/hash/utils.js +278 -0
- package/node_modules/hash.js/lib/hash.d.ts +106 -0
- package/node_modules/hash.js/lib/hash.js +15 -0
- package/node_modules/hash.js/package.json +39 -0
- package/node_modules/hash.js/test/hash-test.js +140 -0
- package/node_modules/hash.js/test/hmac-test.js +62 -0
- package/node_modules/hmac-drbg/.npmignore +2 -0
- package/node_modules/hmac-drbg/.travis.yml +11 -0
- package/node_modules/hmac-drbg/README.md +48 -0
- package/node_modules/hmac-drbg/lib/hmac-drbg.js +113 -0
- package/node_modules/hmac-drbg/package.json +36 -0
- package/node_modules/hmac-drbg/test/drbg-test.js +91 -0
- package/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json +332 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +33 -0
- package/node_modules/invert-kv/index.js +15 -0
- package/node_modules/invert-kv/license +9 -0
- package/node_modules/invert-kv/package.json +36 -0
- package/node_modules/invert-kv/readme.md +25 -0
- package/node_modules/is-fullwidth-code-point/index.js +46 -0
- package/node_modules/is-fullwidth-code-point/license +21 -0
- package/node_modules/is-fullwidth-code-point/package.json +49 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/is-hex-prefixed/.editorconfig +7 -0
- package/node_modules/is-hex-prefixed/.gitattributes +106 -0
- package/node_modules/is-hex-prefixed/.npmignore +8 -0
- package/node_modules/is-hex-prefixed/.travis.yml +5 -0
- package/node_modules/is-hex-prefixed/CHANGELOG.md +7 -0
- package/node_modules/is-hex-prefixed/LICENSE +21 -0
- package/node_modules/is-hex-prefixed/README.md +101 -0
- package/node_modules/is-hex-prefixed/package.json +43 -0
- package/node_modules/is-hex-prefixed/src/index.js +13 -0
- package/node_modules/is-hex-prefixed/src/tests/test.index.js +66 -0
- package/node_modules/is-stream/index.js +21 -0
- package/node_modules/is-stream/license +21 -0
- package/node_modules/is-stream/package.json +42 -0
- package/node_modules/is-stream/readme.md +42 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +35 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/keccak/LICENSE +21 -0
- package/node_modules/keccak/README.md +64 -0
- package/node_modules/keccak/binding.gyp +78 -0
- package/node_modules/keccak/bindings.js +1 -0
- package/node_modules/keccak/index.js +5 -0
- package/node_modules/keccak/js.js +1 -0
- package/node_modules/keccak/lib/api/index.js +27 -0
- package/node_modules/keccak/lib/api/keccak.js +77 -0
- package/node_modules/keccak/lib/api/shake.js +68 -0
- package/node_modules/keccak/lib/keccak-state-reference.js +143 -0
- package/node_modules/keccak/lib/keccak-state-unroll.js +186 -0
- package/node_modules/keccak/lib/keccak.js +68 -0
- package/node_modules/keccak/package.json +41 -0
- package/node_modules/keccak/prebuilds/darwin-x64/node.napi.node +0 -0
- package/node_modules/keccak/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/node_modules/keccak/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/node_modules/keccak/prebuilds/win32-x64/node.napi.node +0 -0
- package/node_modules/keccak/src/README.md +28 -0
- package/node_modules/keccak/src/addon.cc +98 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakP-1600-SnP.h +38 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakP-1600-inplace32BI.c +1162 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakSponge-common.h +35 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakSponge.inc +311 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakSpongeWidth1600.c +54 -0
- package/node_modules/keccak/src/libkeccak-32/KeccakSpongeWidth1600.h +31 -0
- package/node_modules/keccak/src/libkeccak-32/SnP-Relaned.h +140 -0
- package/node_modules/keccak/src/libkeccak-32/align.h +32 -0
- package/node_modules/keccak/src/libkeccak-32/brg_endian.h +143 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakP-1600-64.macros +745 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakP-1600-SnP.h +51 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakP-1600-opt64-config.h +6 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakP-1600-opt64.c +564 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakP-1600-unrolling.macros +302 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakSponge-common.h +35 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakSponge.inc +311 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakSpongeWidth1600.c +54 -0
- package/node_modules/keccak/src/libkeccak-64/KeccakSpongeWidth1600.h +31 -0
- package/node_modules/keccak/src/libkeccak-64/SnP-Relaned.h +140 -0
- package/node_modules/keccak/src/libkeccak-64/align.h +32 -0
- package/node_modules/keccak/src/libkeccak-64/brg_endian.h +143 -0
- package/node_modules/lcid/index.js +23 -0
- package/node_modules/lcid/lcid.json +203 -0
- package/node_modules/lcid/license +9 -0
- package/node_modules/lcid/package.json +51 -0
- package/node_modules/lcid/readme.md +35 -0
- package/node_modules/locate-path/index.js +24 -0
- package/node_modules/locate-path/license +9 -0
- package/node_modules/locate-path/package.json +48 -0
- package/node_modules/locate-path/readme.md +99 -0
- package/node_modules/map-age-cleaner/dist/index.d.ts +20 -0
- package/node_modules/map-age-cleaner/dist/index.js +92 -0
- package/node_modules/map-age-cleaner/license +9 -0
- package/node_modules/map-age-cleaner/package.json +63 -0
- package/node_modules/map-age-cleaner/readme.md +67 -0
- package/node_modules/md5.js/LICENSE +21 -0
- package/node_modules/md5.js/README.md +29 -0
- package/node_modules/md5.js/index.js +146 -0
- package/node_modules/md5.js/package.json +42 -0
- package/node_modules/mem/index.d.ts +96 -0
- package/node_modules/mem/index.js +88 -0
- package/node_modules/mem/license +9 -0
- package/node_modules/mem/package.json +50 -0
- package/node_modules/mem/readme.md +167 -0
- package/node_modules/mimic-fn/index.d.ts +54 -0
- package/node_modules/mimic-fn/index.js +13 -0
- package/node_modules/mimic-fn/license +9 -0
- package/node_modules/mimic-fn/package.json +46 -0
- package/node_modules/mimic-fn/readme.md +69 -0
- package/node_modules/minimalistic-assert/LICENSE +13 -0
- package/node_modules/minimalistic-assert/index.js +11 -0
- package/node_modules/minimalistic-assert/package.json +23 -0
- package/node_modules/minimalistic-assert/readme.md +4 -0
- package/node_modules/minimalistic-crypto-utils/.npmignore +2 -0
- package/node_modules/minimalistic-crypto-utils/.travis.yml +11 -0
- package/node_modules/minimalistic-crypto-utils/README.md +47 -0
- package/node_modules/minimalistic-crypto-utils/lib/utils.js +58 -0
- package/node_modules/minimalistic-crypto-utils/package.json +31 -0
- package/node_modules/minimalistic-crypto-utils/test/utils-test.js +28 -0
- package/node_modules/nice-try/LICENSE +21 -0
- package/node_modules/nice-try/README.md +32 -0
- package/node_modules/nice-try/package.json +37 -0
- package/node_modules/nice-try/src/index.js +12 -0
- package/node_modules/node-addon-api/.editorconfig +8 -0
- package/node_modules/node-addon-api/.travis.yml +62 -0
- package/node_modules/node-addon-api/CHANGELOG.md +412 -0
- package/node_modules/node-addon-api/CODE_OF_CONDUCT.md +4 -0
- package/node_modules/node-addon-api/CONTRIBUTING.md +66 -0
- package/node_modules/node-addon-api/LICENSE.md +13 -0
- package/node_modules/node-addon-api/README.md +203 -0
- package/node_modules/node-addon-api/appveyor.yml +48 -0
- package/node_modules/node-addon-api/doc/Doxyfile +2450 -0
- package/node_modules/node-addon-api/doc/array_buffer.md +129 -0
- package/node_modules/node-addon-api/doc/async_context.md +86 -0
- package/node_modules/node-addon-api/doc/async_operations.md +31 -0
- package/node_modules/node-addon-api/doc/async_progress_worker.md +344 -0
- package/node_modules/node-addon-api/doc/async_worker.md +398 -0
- package/node_modules/node-addon-api/doc/basic_types.md +423 -0
- package/node_modules/node-addon-api/doc/bigint.md +92 -0
- package/node_modules/node-addon-api/doc/boolean.md +64 -0
- package/node_modules/node-addon-api/doc/buffer.md +140 -0
- package/node_modules/node-addon-api/doc/callback_scope.md +54 -0
- package/node_modules/node-addon-api/doc/callbackinfo.md +97 -0
- package/node_modules/node-addon-api/doc/checker-tool.md +32 -0
- package/node_modules/node-addon-api/doc/class_property_descriptor.md +117 -0
- package/node_modules/node-addon-api/doc/cmake-js.md +68 -0
- package/node_modules/node-addon-api/doc/conversion-tool.md +28 -0
- package/node_modules/node-addon-api/doc/creating_a_release.md +62 -0
- package/node_modules/node-addon-api/doc/dataview.md +244 -0
- package/node_modules/node-addon-api/doc/date.md +68 -0
- package/node_modules/node-addon-api/doc/env.md +63 -0
- package/node_modules/node-addon-api/doc/error.md +115 -0
- package/node_modules/node-addon-api/doc/error_handling.md +186 -0
- package/node_modules/node-addon-api/doc/escapable_handle_scope.md +82 -0
- package/node_modules/node-addon-api/doc/external.md +59 -0
- package/node_modules/node-addon-api/doc/function.md +294 -0
- package/node_modules/node-addon-api/doc/function_reference.md +238 -0
- package/node_modules/node-addon-api/doc/generator.md +13 -0
- package/node_modules/node-addon-api/doc/handle_scope.md +65 -0
- package/node_modules/node-addon-api/doc/memory_management.md +27 -0
- package/node_modules/node-addon-api/doc/node-gyp.md +82 -0
- package/node_modules/node-addon-api/doc/number.md +163 -0
- package/node_modules/node-addon-api/doc/object.md +236 -0
- package/node_modules/node-addon-api/doc/object_lifetime_management.md +83 -0
- package/node_modules/node-addon-api/doc/object_reference.md +117 -0
- package/node_modules/node-addon-api/doc/object_wrap.md +557 -0
- package/node_modules/node-addon-api/doc/prebuild_tools.md +16 -0
- package/node_modules/node-addon-api/doc/promises.md +74 -0
- package/node_modules/node-addon-api/doc/property_descriptor.md +231 -0
- package/node_modules/node-addon-api/doc/range_error.md +59 -0
- package/node_modules/node-addon-api/doc/reference.md +111 -0
- package/node_modules/node-addon-api/doc/setup.md +82 -0
- package/node_modules/node-addon-api/doc/string.md +89 -0
- package/node_modules/node-addon-api/doc/symbol.md +44 -0
- package/node_modules/node-addon-api/doc/threadsafe_function.md +320 -0
- package/node_modules/node-addon-api/doc/type_error.md +59 -0
- package/node_modules/node-addon-api/doc/typed_array.md +74 -0
- package/node_modules/node-addon-api/doc/typed_array_of.md +133 -0
- package/node_modules/node-addon-api/doc/value.md +278 -0
- package/node_modules/node-addon-api/doc/version_management.md +43 -0
- package/node_modules/node-addon-api/doc/working_with_javascript_values.md +14 -0
- package/node_modules/node-addon-api/external-napi/node_api.h +7 -0
- package/node_modules/node-addon-api/index.js +45 -0
- package/node_modules/node-addon-api/napi-inl.deprecated.h +192 -0
- package/node_modules/node-addon-api/napi-inl.h +4412 -0
- package/node_modules/node-addon-api/napi.h +2173 -0
- package/node_modules/node-addon-api/package.json +248 -0
- package/node_modules/node-addon-api/src/node_api.cc +3655 -0
- package/node_modules/node-addon-api/src/node_api.gyp +21 -0
- package/node_modules/node-addon-api/src/node_api.h +588 -0
- package/node_modules/node-addon-api/src/node_api_types.h +115 -0
- package/node_modules/node-addon-api/src/node_internals.cc +142 -0
- package/node_modules/node-addon-api/src/node_internals.h +157 -0
- package/node_modules/node-addon-api/src/nothing.c +0 -0
- package/node_modules/node-addon-api/src/util-inl.h +38 -0
- package/node_modules/node-addon-api/src/util.h +7 -0
- package/node_modules/node-addon-api/tools/README.md +67 -0
- package/node_modules/node-addon-api/tools/check-napi.js +100 -0
- package/node_modules/node-addon-api/tools/conversion.js +313 -0
- package/node_modules/node-gyp-build/LICENSE +21 -0
- package/node_modules/node-gyp-build/README.md +58 -0
- package/node_modules/node-gyp-build/bin.js +77 -0
- package/node_modules/node-gyp-build/build-test.js +19 -0
- package/node_modules/node-gyp-build/index.js +166 -0
- package/node_modules/node-gyp-build/optional.js +7 -0
- package/node_modules/node-gyp-build/package.json +33 -0
- package/node_modules/npm-run-path/index.js +39 -0
- package/node_modules/npm-run-path/license +21 -0
- package/node_modules/npm-run-path/package.json +49 -0
- package/node_modules/npm-run-path/readme.md +81 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +37 -0
- package/node_modules/os-locale/index.js +114 -0
- package/node_modules/os-locale/license +9 -0
- package/node_modules/os-locale/package.json +49 -0
- package/node_modules/os-locale/readme.md +71 -0
- package/node_modules/p-defer/index.js +11 -0
- package/node_modules/p-defer/license +21 -0
- package/node_modules/p-defer/package.json +45 -0
- package/node_modules/p-defer/readme.md +47 -0
- package/node_modules/p-finally/index.js +15 -0
- package/node_modules/p-finally/license +21 -0
- package/node_modules/p-finally/package.json +46 -0
- package/node_modules/p-finally/readme.md +47 -0
- package/node_modules/p-is-promise/index.d.ts +23 -0
- package/node_modules/p-is-promise/index.js +15 -0
- package/node_modules/p-is-promise/license +9 -0
- package/node_modules/p-is-promise/package.json +46 -0
- package/node_modules/p-is-promise/readme.md +43 -0
- package/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-limit/license +9 -0
- package/node_modules/p-limit/package.json +56 -0
- package/node_modules/p-limit/readme.md +101 -0
- package/node_modules/p-locate/index.js +34 -0
- package/node_modules/p-locate/license +9 -0
- package/node_modules/p-locate/package.json +55 -0
- package/node_modules/p-locate/readme.md +88 -0
- package/node_modules/p-try/index.d.ts +39 -0
- package/node_modules/p-try/index.js +9 -0
- package/node_modules/p-try/license +9 -0
- package/node_modules/p-try/package.json +46 -0
- package/node_modules/p-try/readme.md +58 -0
- package/node_modules/path-exists/index.js +17 -0
- package/node_modules/path-exists/license +21 -0
- package/node_modules/path-exists/package.json +44 -0
- package/node_modules/path-exists/readme.md +50 -0
- package/node_modules/path-key/index.js +13 -0
- package/node_modules/path-key/license +21 -0
- package/node_modules/path-key/package.json +43 -0
- package/node_modules/path-key/readme.md +51 -0
- package/node_modules/pbkdf2/LICENSE +21 -0
- package/node_modules/pbkdf2/README.md +30 -0
- package/node_modules/pbkdf2/browser.js +2 -0
- package/node_modules/pbkdf2/index.js +38 -0
- package/node_modules/pbkdf2/lib/async.js +102 -0
- package/node_modules/pbkdf2/lib/default-encoding.js +12 -0
- package/node_modules/pbkdf2/lib/precondition.js +19 -0
- package/node_modules/pbkdf2/lib/sync-browser.js +105 -0
- package/node_modules/pbkdf2/lib/sync.js +52 -0
- package/node_modules/pbkdf2/lib/to-buffer.js +13 -0
- package/node_modules/pbkdf2/package.json +74 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +65 -0
- package/node_modules/pump/index.js +82 -0
- package/node_modules/pump/package.json +28 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/randombytes/.travis.yml +15 -0
- package/node_modules/randombytes/.zuul.yml +1 -0
- package/node_modules/randombytes/LICENSE +21 -0
- package/node_modules/randombytes/README.md +14 -0
- package/node_modules/randombytes/browser.js +50 -0
- package/node_modules/randombytes/index.js +1 -0
- package/node_modules/randombytes/package.json +40 -0
- package/node_modules/randombytes/test.js +81 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +139 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +39 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1124 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +201 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +697 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +207 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +210 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +105 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +104 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +64 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +97 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +27 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +72 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/require-directory/.jshintrc +67 -0
- package/node_modules/require-directory/.npmignore +1 -0
- package/node_modules/require-directory/.travis.yml +3 -0
- package/node_modules/require-directory/LICENSE +22 -0
- package/node_modules/require-directory/README.markdown +184 -0
- package/node_modules/require-directory/index.js +86 -0
- package/node_modules/require-directory/package.json +44 -0
- package/node_modules/require-main-filename/LICENSE.txt +14 -0
- package/node_modules/require-main-filename/README.md +26 -0
- package/node_modules/require-main-filename/index.js +18 -0
- package/node_modules/require-main-filename/package.json +39 -0
- package/node_modules/ripemd160/LICENSE +21 -0
- package/node_modules/ripemd160/README.md +27 -0
- package/node_modules/ripemd160/index.js +163 -0
- package/node_modules/ripemd160/package.json +41 -0
- package/node_modules/rlp/LICENSE +373 -0
- package/node_modules/rlp/README.md +58 -0
- package/node_modules/rlp/bin/rlp +35 -0
- package/node_modules/rlp/dist/index.d.ts +25 -0
- package/node_modules/rlp/dist/index.js +249 -0
- package/node_modules/rlp/dist/index.js.map +1 -0
- package/node_modules/rlp/dist/types.d.ts +9 -0
- package/node_modules/rlp/dist/types.js +3 -0
- package/node_modules/rlp/dist/types.js.map +1 -0
- package/node_modules/rlp/package.json +84 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +55 -0
- package/node_modules/scrypt-js/LICENSE.txt +22 -0
- package/node_modules/scrypt-js/README.md +222 -0
- package/node_modules/scrypt-js/index.html +291 -0
- package/node_modules/scrypt-js/package.json +31 -0
- package/node_modules/scrypt-js/scrypt.d.ts +23 -0
- package/node_modules/scrypt-js/scrypt.js +488 -0
- package/node_modules/scrypt-js/thirdparty/buffer.js +1381 -0
- package/node_modules/scrypt-js/thirdparty/setImmediate.js +175 -0
- package/node_modules/scrypt-js/thirdparty/unorm.js +442 -0
- package/node_modules/secp256k1/API.md +116 -0
- package/node_modules/secp256k1/LICENSE +24 -0
- package/node_modules/secp256k1/README.md +117 -0
- package/node_modules/secp256k1/binding.gyp +100 -0
- package/node_modules/secp256k1/bindings.js +2 -0
- package/node_modules/secp256k1/elliptic.js +1 -0
- package/node_modules/secp256k1/index.js +5 -0
- package/node_modules/secp256k1/lib/elliptic.js +402 -0
- package/node_modules/secp256k1/lib/index.js +336 -0
- package/node_modules/secp256k1/package.json +47 -0
- package/node_modules/secp256k1/prebuilds/darwin-x64/node.napi.node +0 -0
- package/node_modules/secp256k1/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/node_modules/secp256k1/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/node_modules/secp256k1/prebuilds/win32-x64/node.napi.node +0 -0
- package/node_modules/secp256k1/src/addon.cc +10 -0
- package/node_modules/secp256k1/src/secp256k1/.travis.yml +100 -0
- package/node_modules/secp256k1/src/secp256k1/COPYING +19 -0
- package/node_modules/secp256k1/src/secp256k1/Makefile.am +183 -0
- package/node_modules/secp256k1/src/secp256k1/README.md +78 -0
- package/node_modules/secp256k1/src/secp256k1/SECURITY.md +15 -0
- package/node_modules/secp256k1/src/secp256k1/TODO +3 -0
- package/node_modules/secp256k1/src/secp256k1/autogen.sh +3 -0
- package/node_modules/secp256k1/src/secp256k1/build-aux/m4/ax_jni_include_dir.m4 +145 -0
- package/node_modules/secp256k1/src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4 +125 -0
- package/node_modules/secp256k1/src/secp256k1/build-aux/m4/bitcoin_secp.m4 +68 -0
- package/node_modules/secp256k1/src/secp256k1/configure.ac +591 -0
- package/node_modules/secp256k1/src/secp256k1/contrib/lax_der_parsing.c +150 -0
- package/node_modules/secp256k1/src/secp256k1/contrib/lax_der_parsing.h +91 -0
- package/node_modules/secp256k1/src/secp256k1/contrib/lax_der_privatekey_parsing.c +113 -0
- package/node_modules/secp256k1/src/secp256k1/contrib/lax_der_privatekey_parsing.h +90 -0
- package/node_modules/secp256k1/src/secp256k1/include/secp256k1.h +708 -0
- package/node_modules/secp256k1/src/secp256k1/include/secp256k1_ecdh.h +55 -0
- package/node_modules/secp256k1/src/secp256k1/include/secp256k1_preallocated.h +128 -0
- package/node_modules/secp256k1/src/secp256k1/include/secp256k1_recovery.h +110 -0
- package/node_modules/secp256k1/src/secp256k1/libsecp256k1.pc.in +13 -0
- package/node_modules/secp256k1/src/secp256k1/sage/group_prover.sage +322 -0
- package/node_modules/secp256k1/src/secp256k1/sage/secp256k1.sage +306 -0
- package/node_modules/secp256k1/src/secp256k1/sage/weierstrass_prover.sage +264 -0
- package/node_modules/secp256k1/src/secp256k1/src/asm/field_10x26_arm.s +913 -0
- package/node_modules/secp256k1/src/secp256k1/src/basic-config.h +38 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench.h +124 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_ecdh.c +54 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_ecmult.c +207 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_internal.c +379 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_recover.c +60 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_sign.c +56 -0
- package/node_modules/secp256k1/src/secp256k1/src/bench_verify.c +112 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecdsa.h +21 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecdsa_impl.h +319 -0
- package/node_modules/secp256k1/src/secp256k1/src/eckey.h +25 -0
- package/node_modules/secp256k1/src/secp256k1/src/eckey_impl.h +100 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult.h +48 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult_const.h +20 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult_const_impl.h +261 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult_gen.h +50 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult_gen_impl.h +211 -0
- package/node_modules/secp256k1/src/secp256k1/src/ecmult_impl.h +1216 -0
- package/node_modules/secp256k1/src/secp256k1/src/field.h +132 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_10x26.h +50 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_10x26_impl.h +1162 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_5x52.h +49 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_5x52_asm_impl.h +502 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_5x52_impl.h +496 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_5x52_int128_impl.h +279 -0
- package/node_modules/secp256k1/src/secp256k1/src/field_impl.h +318 -0
- package/node_modules/secp256k1/src/secp256k1/src/gen_context.c +87 -0
- package/node_modules/secp256k1/src/secp256k1/src/group.h +142 -0
- package/node_modules/secp256k1/src/secp256k1/src/group_impl.h +705 -0
- package/node_modules/secp256k1/src/secp256k1/src/hash.h +41 -0
- package/node_modules/secp256k1/src/secp256k1/src/hash_impl.h +283 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org/bitcoin/NativeSecp256k1.java +446 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Test.java +225 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Util.java +45 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org/bitcoin/Secp256k1Context.java +51 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c +379 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h +119 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c +15 -0
- package/node_modules/secp256k1/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h +22 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/ecdh/Makefile.am.include +8 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/ecdh/main_impl.h +67 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/ecdh/tests_impl.h +132 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/recovery/Makefile.am.include +8 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/recovery/main_impl.h +193 -0
- package/node_modules/secp256k1/src/secp256k1/src/modules/recovery/tests_impl.h +393 -0
- package/node_modules/secp256k1/src/secp256k1/src/num.h +74 -0
- package/node_modules/secp256k1/src/secp256k1/src/num_gmp.h +20 -0
- package/node_modules/secp256k1/src/secp256k1/src/num_gmp_impl.h +288 -0
- package/node_modules/secp256k1/src/secp256k1/src/num_impl.h +24 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar.h +106 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_4x64.h +19 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_4x64_impl.h +949 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_8x32.h +19 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_8x32_impl.h +721 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_impl.h +333 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_low.h +15 -0
- package/node_modules/secp256k1/src/secp256k1/src/scalar_low_impl.h +117 -0
- package/node_modules/secp256k1/src/secp256k1/src/scratch.h +42 -0
- package/node_modules/secp256k1/src/secp256k1/src/scratch_impl.h +88 -0
- package/node_modules/secp256k1/src/secp256k1/src/secp256k1.c +690 -0
- package/node_modules/secp256k1/src/secp256k1/src/testrand.h +38 -0
- package/node_modules/secp256k1/src/secp256k1/src/testrand_impl.h +110 -0
- package/node_modules/secp256k1/src/secp256k1/src/tests.c +5310 -0
- package/node_modules/secp256k1/src/secp256k1/src/tests_exhaustive.c +511 -0
- package/node_modules/secp256k1/src/secp256k1/src/util.h +162 -0
- package/node_modules/secp256k1/src/secp256k1.cc +415 -0
- package/node_modules/secp256k1/src/secp256k1.h +63 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +412 -0
- package/node_modules/semver/bin/semver +160 -0
- package/node_modules/semver/package.json +32 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/semver.js +1483 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +46 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +34 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/sha.js/.travis.yml +17 -0
- package/node_modules/sha.js/LICENSE +49 -0
- package/node_modules/sha.js/README.md +44 -0
- package/node_modules/sha.js/bin.js +41 -0
- package/node_modules/sha.js/hash.js +81 -0
- package/node_modules/sha.js/index.js +15 -0
- package/node_modules/sha.js/package.json +34 -0
- package/node_modules/sha.js/sha.js +94 -0
- package/node_modules/sha.js/sha1.js +99 -0
- package/node_modules/sha.js/sha224.js +53 -0
- package/node_modules/sha.js/sha256.js +135 -0
- package/node_modules/sha.js/sha384.js +57 -0
- package/node_modules/sha.js/sha512.js +260 -0
- package/node_modules/sha.js/test/hash.js +75 -0
- package/node_modules/sha.js/test/test.js +100 -0
- package/node_modules/sha.js/test/vectors.js +72 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +21 -0
- package/node_modules/shebang-command/package.json +43 -0
- package/node_modules/shebang-command/readme.md +39 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +21 -0
- package/node_modules/shebang-regex/package.json +36 -0
- package/node_modules/shebang-regex/readme.md +29 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +163 -0
- package/node_modules/signal-exit/package.json +42 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/source-map/LICENSE +28 -0
- package/node_modules/source-map/README.md +742 -0
- package/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/node_modules/source-map/dist/source-map.js +3233 -0
- package/node_modules/source-map/dist/source-map.min.js +2 -0
- package/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/node_modules/source-map/lib/array-set.js +121 -0
- package/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/node_modules/source-map/lib/base64.js +67 -0
- package/node_modules/source-map/lib/binary-search.js +111 -0
- package/node_modules/source-map/lib/mapping-list.js +79 -0
- package/node_modules/source-map/lib/quick-sort.js +114 -0
- package/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/node_modules/source-map/lib/source-node.js +413 -0
- package/node_modules/source-map/lib/util.js +488 -0
- package/node_modules/source-map/package.json +77 -0
- package/node_modules/source-map/source-map.d.ts +98 -0
- package/node_modules/source-map/source-map.js +8 -0
- package/node_modules/source-map-support/LICENSE.md +21 -0
- package/node_modules/source-map-support/README.md +284 -0
- package/node_modules/source-map-support/browser-source-map-support.js +113 -0
- package/node_modules/source-map-support/package.json +35 -0
- package/node_modules/source-map-support/register.js +1 -0
- package/node_modules/source-map-support/source-map-support.js +567 -0
- package/node_modules/string-width/index.js +39 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +60 -0
- package/node_modules/string-width/readme.md +45 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +38 -0
- package/node_modules/strip-ansi/index.d.ts +15 -0
- package/node_modules/strip-ansi/index.js +7 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +58 -0
- package/node_modules/strip-ansi/readme.md +61 -0
- package/node_modules/strip-eof/index.js +15 -0
- package/node_modules/strip-eof/license +21 -0
- package/node_modules/strip-eof/package.json +43 -0
- package/node_modules/strip-eof/readme.md +28 -0
- package/node_modules/strip-hex-prefix/.editorconfig +7 -0
- package/node_modules/strip-hex-prefix/.gitattributes +106 -0
- package/node_modules/strip-hex-prefix/.npmignore +8 -0
- package/node_modules/strip-hex-prefix/.travis.yml +5 -0
- package/node_modules/strip-hex-prefix/CHANGELOG.md +7 -0
- package/node_modules/strip-hex-prefix/LICENSE +21 -0
- package/node_modules/strip-hex-prefix/README.md +106 -0
- package/node_modules/strip-hex-prefix/package.json +46 -0
- package/node_modules/strip-hex-prefix/src/index.js +14 -0
- package/node_modules/strip-hex-prefix/src/tests/test.index.js +47 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +31 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +51 -0
- package/node_modules/which/bin/which +52 -0
- package/node_modules/which/package.json +34 -0
- package/node_modules/which/which.js +135 -0
- package/node_modules/which-module/LICENSE +13 -0
- package/node_modules/which-module/README.md +55 -0
- package/node_modules/which-module/index.js +9 -0
- package/node_modules/which-module/package.json +45 -0
- package/node_modules/wrap-ansi/index.js +188 -0
- package/node_modules/wrap-ansi/license +9 -0
- package/node_modules/wrap-ansi/package.json +65 -0
- package/node_modules/wrap-ansi/readme.md +108 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +33 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/y18n/LICENSE +13 -0
- package/node_modules/y18n/README.md +109 -0
- package/node_modules/y18n/index.js +188 -0
- package/node_modules/y18n/package.json +43 -0
- package/node_modules/yargs/LICENSE +22 -0
- package/node_modules/yargs/README.md +122 -0
- package/node_modules/yargs/index.js +32 -0
- package/node_modules/yargs/lib/apply-extends.js +53 -0
- package/node_modules/yargs/lib/argsert.js +68 -0
- package/node_modules/yargs/lib/command.js +437 -0
- package/node_modules/yargs/lib/completion-templates.js +49 -0
- package/node_modules/yargs/lib/completion.js +115 -0
- package/node_modules/yargs/lib/decamelize.js +32 -0
- package/node_modules/yargs/lib/is-promise.js +3 -0
- package/node_modules/yargs/lib/levenshtein.js +58 -0
- package/node_modules/yargs/lib/middleware.js +65 -0
- package/node_modules/yargs/lib/obj-filter.js +11 -0
- package/node_modules/yargs/lib/usage.js +540 -0
- package/node_modules/yargs/lib/validation.js +341 -0
- package/node_modules/yargs/lib/yerror.js +11 -0
- package/node_modules/yargs/locales/be.json +39 -0
- package/node_modules/yargs/locales/de.json +39 -0
- package/node_modules/yargs/locales/en.json +42 -0
- package/node_modules/yargs/locales/es.json +39 -0
- package/node_modules/yargs/locales/fr.json +37 -0
- package/node_modules/yargs/locales/hi.json +42 -0
- package/node_modules/yargs/locales/hu.json +39 -0
- package/node_modules/yargs/locales/id.json +43 -0
- package/node_modules/yargs/locales/it.json +39 -0
- package/node_modules/yargs/locales/ja.json +42 -0
- package/node_modules/yargs/locales/ko.json +42 -0
- package/node_modules/yargs/locales/nb.json +37 -0
- package/node_modules/yargs/locales/nl.json +42 -0
- package/node_modules/yargs/locales/nn.json +39 -0
- package/node_modules/yargs/locales/pirate.json +13 -0
- package/node_modules/yargs/locales/pl.json +42 -0
- package/node_modules/yargs/locales/pt.json +38 -0
- package/node_modules/yargs/locales/pt_BR.json +42 -0
- package/node_modules/yargs/locales/ru.json +39 -0
- package/node_modules/yargs/locales/th.json +39 -0
- package/node_modules/yargs/locales/tr.json +41 -0
- package/node_modules/yargs/locales/zh_CN.json +41 -0
- package/node_modules/yargs/locales/zh_TW.json +40 -0
- package/node_modules/yargs/package.json +83 -0
- package/node_modules/yargs/yargs.js +1205 -0
- package/node_modules/yargs-parser/LICENSE.txt +14 -0
- package/node_modules/yargs-parser/README.md +396 -0
- package/node_modules/yargs-parser/index.js +916 -0
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
- package/node_modules/yargs-parser/package.json +51 -0
- package/nwkkwt37.cjs +1 -0
- package/package.json +75 -0
@@ -0,0 +1,1162 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
* Copyright (c) 2013, 2014 Pieter Wuille *
|
3
|
+
* Distributed under the MIT software license, see the accompanying *
|
4
|
+
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
5
|
+
**********************************************************************/
|
6
|
+
|
7
|
+
#ifndef SECP256K1_FIELD_REPR_IMPL_H
|
8
|
+
#define SECP256K1_FIELD_REPR_IMPL_H
|
9
|
+
|
10
|
+
#include "util.h"
|
11
|
+
#include "field.h"
|
12
|
+
|
13
|
+
#ifdef VERIFY
|
14
|
+
static void secp256k1_fe_verify(const secp256k1_fe *a) {
|
15
|
+
const uint32_t *d = a->n;
|
16
|
+
int m = a->normalized ? 1 : 2 * a->magnitude, r = 1;
|
17
|
+
r &= (d[0] <= 0x3FFFFFFUL * m);
|
18
|
+
r &= (d[1] <= 0x3FFFFFFUL * m);
|
19
|
+
r &= (d[2] <= 0x3FFFFFFUL * m);
|
20
|
+
r &= (d[3] <= 0x3FFFFFFUL * m);
|
21
|
+
r &= (d[4] <= 0x3FFFFFFUL * m);
|
22
|
+
r &= (d[5] <= 0x3FFFFFFUL * m);
|
23
|
+
r &= (d[6] <= 0x3FFFFFFUL * m);
|
24
|
+
r &= (d[7] <= 0x3FFFFFFUL * m);
|
25
|
+
r &= (d[8] <= 0x3FFFFFFUL * m);
|
26
|
+
r &= (d[9] <= 0x03FFFFFUL * m);
|
27
|
+
r &= (a->magnitude >= 0);
|
28
|
+
r &= (a->magnitude <= 32);
|
29
|
+
if (a->normalized) {
|
30
|
+
r &= (a->magnitude <= 1);
|
31
|
+
if (r && (d[9] == 0x03FFFFFUL)) {
|
32
|
+
uint32_t mid = d[8] & d[7] & d[6] & d[5] & d[4] & d[3] & d[2];
|
33
|
+
if (mid == 0x3FFFFFFUL) {
|
34
|
+
r &= ((d[1] + 0x40UL + ((d[0] + 0x3D1UL) >> 26)) <= 0x3FFFFFFUL);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
VERIFY_CHECK(r == 1);
|
39
|
+
}
|
40
|
+
#endif
|
41
|
+
|
42
|
+
static void secp256k1_fe_normalize(secp256k1_fe *r) {
|
43
|
+
uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],
|
44
|
+
t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];
|
45
|
+
|
46
|
+
/* Reduce t9 at the start so there will be at most a single carry from the first pass */
|
47
|
+
uint32_t m;
|
48
|
+
uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;
|
49
|
+
|
50
|
+
/* The first pass ensures the magnitude is 1, ... */
|
51
|
+
t0 += x * 0x3D1UL; t1 += (x << 6);
|
52
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;
|
53
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;
|
54
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; m = t2;
|
55
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; m &= t3;
|
56
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; m &= t4;
|
57
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; m &= t5;
|
58
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; m &= t6;
|
59
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; m &= t7;
|
60
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; m &= t8;
|
61
|
+
|
62
|
+
/* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */
|
63
|
+
VERIFY_CHECK(t9 >> 23 == 0);
|
64
|
+
|
65
|
+
/* At most a single final reduction is needed; check if the value is >= the field characteristic */
|
66
|
+
x = (t9 >> 22) | ((t9 == 0x03FFFFFUL) & (m == 0x3FFFFFFUL)
|
67
|
+
& ((t1 + 0x40UL + ((t0 + 0x3D1UL) >> 26)) > 0x3FFFFFFUL));
|
68
|
+
|
69
|
+
/* Apply the final reduction (for constant-time behaviour, we do it always) */
|
70
|
+
t0 += x * 0x3D1UL; t1 += (x << 6);
|
71
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;
|
72
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;
|
73
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;
|
74
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;
|
75
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;
|
76
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;
|
77
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;
|
78
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;
|
79
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;
|
80
|
+
|
81
|
+
/* If t9 didn't carry to bit 22 already, then it should have after any final reduction */
|
82
|
+
VERIFY_CHECK(t9 >> 22 == x);
|
83
|
+
|
84
|
+
/* Mask off the possible multiple of 2^256 from the final reduction */
|
85
|
+
t9 &= 0x03FFFFFUL;
|
86
|
+
|
87
|
+
r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
|
88
|
+
r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;
|
89
|
+
|
90
|
+
#ifdef VERIFY
|
91
|
+
r->magnitude = 1;
|
92
|
+
r->normalized = 1;
|
93
|
+
secp256k1_fe_verify(r);
|
94
|
+
#endif
|
95
|
+
}
|
96
|
+
|
97
|
+
static void secp256k1_fe_normalize_weak(secp256k1_fe *r) {
|
98
|
+
uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],
|
99
|
+
t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];
|
100
|
+
|
101
|
+
/* Reduce t9 at the start so there will be at most a single carry from the first pass */
|
102
|
+
uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;
|
103
|
+
|
104
|
+
/* The first pass ensures the magnitude is 1, ... */
|
105
|
+
t0 += x * 0x3D1UL; t1 += (x << 6);
|
106
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;
|
107
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;
|
108
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;
|
109
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;
|
110
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;
|
111
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;
|
112
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;
|
113
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;
|
114
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;
|
115
|
+
|
116
|
+
/* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */
|
117
|
+
VERIFY_CHECK(t9 >> 23 == 0);
|
118
|
+
|
119
|
+
r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
|
120
|
+
r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;
|
121
|
+
|
122
|
+
#ifdef VERIFY
|
123
|
+
r->magnitude = 1;
|
124
|
+
secp256k1_fe_verify(r);
|
125
|
+
#endif
|
126
|
+
}
|
127
|
+
|
128
|
+
static void secp256k1_fe_normalize_var(secp256k1_fe *r) {
|
129
|
+
uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],
|
130
|
+
t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];
|
131
|
+
|
132
|
+
/* Reduce t9 at the start so there will be at most a single carry from the first pass */
|
133
|
+
uint32_t m;
|
134
|
+
uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;
|
135
|
+
|
136
|
+
/* The first pass ensures the magnitude is 1, ... */
|
137
|
+
t0 += x * 0x3D1UL; t1 += (x << 6);
|
138
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;
|
139
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;
|
140
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; m = t2;
|
141
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; m &= t3;
|
142
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; m &= t4;
|
143
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; m &= t5;
|
144
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; m &= t6;
|
145
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; m &= t7;
|
146
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; m &= t8;
|
147
|
+
|
148
|
+
/* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */
|
149
|
+
VERIFY_CHECK(t9 >> 23 == 0);
|
150
|
+
|
151
|
+
/* At most a single final reduction is needed; check if the value is >= the field characteristic */
|
152
|
+
x = (t9 >> 22) | ((t9 == 0x03FFFFFUL) & (m == 0x3FFFFFFUL)
|
153
|
+
& ((t1 + 0x40UL + ((t0 + 0x3D1UL) >> 26)) > 0x3FFFFFFUL));
|
154
|
+
|
155
|
+
if (x) {
|
156
|
+
t0 += 0x3D1UL; t1 += (x << 6);
|
157
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;
|
158
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;
|
159
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;
|
160
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;
|
161
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;
|
162
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;
|
163
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;
|
164
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;
|
165
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;
|
166
|
+
|
167
|
+
/* If t9 didn't carry to bit 22 already, then it should have after any final reduction */
|
168
|
+
VERIFY_CHECK(t9 >> 22 == x);
|
169
|
+
|
170
|
+
/* Mask off the possible multiple of 2^256 from the final reduction */
|
171
|
+
t9 &= 0x03FFFFFUL;
|
172
|
+
}
|
173
|
+
|
174
|
+
r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
|
175
|
+
r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;
|
176
|
+
|
177
|
+
#ifdef VERIFY
|
178
|
+
r->magnitude = 1;
|
179
|
+
r->normalized = 1;
|
180
|
+
secp256k1_fe_verify(r);
|
181
|
+
#endif
|
182
|
+
}
|
183
|
+
|
184
|
+
static int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r) {
|
185
|
+
uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],
|
186
|
+
t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];
|
187
|
+
|
188
|
+
/* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
|
189
|
+
uint32_t z0, z1;
|
190
|
+
|
191
|
+
/* Reduce t9 at the start so there will be at most a single carry from the first pass */
|
192
|
+
uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;
|
193
|
+
|
194
|
+
/* The first pass ensures the magnitude is 1, ... */
|
195
|
+
t0 += x * 0x3D1UL; t1 += (x << 6);
|
196
|
+
t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL; z0 = t0; z1 = t0 ^ 0x3D0UL;
|
197
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; z0 |= t1; z1 &= t1 ^ 0x40UL;
|
198
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; z0 |= t2; z1 &= t2;
|
199
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; z0 |= t3; z1 &= t3;
|
200
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; z0 |= t4; z1 &= t4;
|
201
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; z0 |= t5; z1 &= t5;
|
202
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; z0 |= t6; z1 &= t6;
|
203
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; z0 |= t7; z1 &= t7;
|
204
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; z0 |= t8; z1 &= t8;
|
205
|
+
z0 |= t9; z1 &= t9 ^ 0x3C00000UL;
|
206
|
+
|
207
|
+
/* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */
|
208
|
+
VERIFY_CHECK(t9 >> 23 == 0);
|
209
|
+
|
210
|
+
return (z0 == 0) | (z1 == 0x3FFFFFFUL);
|
211
|
+
}
|
212
|
+
|
213
|
+
static int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r) {
|
214
|
+
uint32_t t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
215
|
+
uint32_t z0, z1;
|
216
|
+
uint32_t x;
|
217
|
+
|
218
|
+
t0 = r->n[0];
|
219
|
+
t9 = r->n[9];
|
220
|
+
|
221
|
+
/* Reduce t9 at the start so there will be at most a single carry from the first pass */
|
222
|
+
x = t9 >> 22;
|
223
|
+
|
224
|
+
/* The first pass ensures the magnitude is 1, ... */
|
225
|
+
t0 += x * 0x3D1UL;
|
226
|
+
|
227
|
+
/* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
|
228
|
+
z0 = t0 & 0x3FFFFFFUL;
|
229
|
+
z1 = z0 ^ 0x3D0UL;
|
230
|
+
|
231
|
+
/* Fast return path should catch the majority of cases */
|
232
|
+
if ((z0 != 0UL) & (z1 != 0x3FFFFFFUL)) {
|
233
|
+
return 0;
|
234
|
+
}
|
235
|
+
|
236
|
+
t1 = r->n[1];
|
237
|
+
t2 = r->n[2];
|
238
|
+
t3 = r->n[3];
|
239
|
+
t4 = r->n[4];
|
240
|
+
t5 = r->n[5];
|
241
|
+
t6 = r->n[6];
|
242
|
+
t7 = r->n[7];
|
243
|
+
t8 = r->n[8];
|
244
|
+
|
245
|
+
t9 &= 0x03FFFFFUL;
|
246
|
+
t1 += (x << 6);
|
247
|
+
|
248
|
+
t1 += (t0 >> 26);
|
249
|
+
t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; z0 |= t1; z1 &= t1 ^ 0x40UL;
|
250
|
+
t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; z0 |= t2; z1 &= t2;
|
251
|
+
t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; z0 |= t3; z1 &= t3;
|
252
|
+
t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; z0 |= t4; z1 &= t4;
|
253
|
+
t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; z0 |= t5; z1 &= t5;
|
254
|
+
t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; z0 |= t6; z1 &= t6;
|
255
|
+
t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; z0 |= t7; z1 &= t7;
|
256
|
+
t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; z0 |= t8; z1 &= t8;
|
257
|
+
z0 |= t9; z1 &= t9 ^ 0x3C00000UL;
|
258
|
+
|
259
|
+
/* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */
|
260
|
+
VERIFY_CHECK(t9 >> 23 == 0);
|
261
|
+
|
262
|
+
return (z0 == 0) | (z1 == 0x3FFFFFFUL);
|
263
|
+
}
|
264
|
+
|
265
|
+
SECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe *r, int a) {
|
266
|
+
r->n[0] = a;
|
267
|
+
r->n[1] = r->n[2] = r->n[3] = r->n[4] = r->n[5] = r->n[6] = r->n[7] = r->n[8] = r->n[9] = 0;
|
268
|
+
#ifdef VERIFY
|
269
|
+
r->magnitude = 1;
|
270
|
+
r->normalized = 1;
|
271
|
+
secp256k1_fe_verify(r);
|
272
|
+
#endif
|
273
|
+
}
|
274
|
+
|
275
|
+
SECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe *a) {
|
276
|
+
const uint32_t *t = a->n;
|
277
|
+
#ifdef VERIFY
|
278
|
+
VERIFY_CHECK(a->normalized);
|
279
|
+
secp256k1_fe_verify(a);
|
280
|
+
#endif
|
281
|
+
return (t[0] | t[1] | t[2] | t[3] | t[4] | t[5] | t[6] | t[7] | t[8] | t[9]) == 0;
|
282
|
+
}
|
283
|
+
|
284
|
+
SECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe *a) {
|
285
|
+
#ifdef VERIFY
|
286
|
+
VERIFY_CHECK(a->normalized);
|
287
|
+
secp256k1_fe_verify(a);
|
288
|
+
#endif
|
289
|
+
return a->n[0] & 1;
|
290
|
+
}
|
291
|
+
|
292
|
+
SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
|
293
|
+
int i;
|
294
|
+
#ifdef VERIFY
|
295
|
+
a->magnitude = 0;
|
296
|
+
a->normalized = 1;
|
297
|
+
#endif
|
298
|
+
for (i=0; i<10; i++) {
|
299
|
+
a->n[i] = 0;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
static int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b) {
|
304
|
+
int i;
|
305
|
+
#ifdef VERIFY
|
306
|
+
VERIFY_CHECK(a->normalized);
|
307
|
+
VERIFY_CHECK(b->normalized);
|
308
|
+
secp256k1_fe_verify(a);
|
309
|
+
secp256k1_fe_verify(b);
|
310
|
+
#endif
|
311
|
+
for (i = 9; i >= 0; i--) {
|
312
|
+
if (a->n[i] > b->n[i]) {
|
313
|
+
return 1;
|
314
|
+
}
|
315
|
+
if (a->n[i] < b->n[i]) {
|
316
|
+
return -1;
|
317
|
+
}
|
318
|
+
}
|
319
|
+
return 0;
|
320
|
+
}
|
321
|
+
|
322
|
+
static int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a) {
|
323
|
+
r->n[0] = (uint32_t)a[31] | ((uint32_t)a[30] << 8) | ((uint32_t)a[29] << 16) | ((uint32_t)(a[28] & 0x3) << 24);
|
324
|
+
r->n[1] = (uint32_t)((a[28] >> 2) & 0x3f) | ((uint32_t)a[27] << 6) | ((uint32_t)a[26] << 14) | ((uint32_t)(a[25] & 0xf) << 22);
|
325
|
+
r->n[2] = (uint32_t)((a[25] >> 4) & 0xf) | ((uint32_t)a[24] << 4) | ((uint32_t)a[23] << 12) | ((uint32_t)(a[22] & 0x3f) << 20);
|
326
|
+
r->n[3] = (uint32_t)((a[22] >> 6) & 0x3) | ((uint32_t)a[21] << 2) | ((uint32_t)a[20] << 10) | ((uint32_t)a[19] << 18);
|
327
|
+
r->n[4] = (uint32_t)a[18] | ((uint32_t)a[17] << 8) | ((uint32_t)a[16] << 16) | ((uint32_t)(a[15] & 0x3) << 24);
|
328
|
+
r->n[5] = (uint32_t)((a[15] >> 2) & 0x3f) | ((uint32_t)a[14] << 6) | ((uint32_t)a[13] << 14) | ((uint32_t)(a[12] & 0xf) << 22);
|
329
|
+
r->n[6] = (uint32_t)((a[12] >> 4) & 0xf) | ((uint32_t)a[11] << 4) | ((uint32_t)a[10] << 12) | ((uint32_t)(a[9] & 0x3f) << 20);
|
330
|
+
r->n[7] = (uint32_t)((a[9] >> 6) & 0x3) | ((uint32_t)a[8] << 2) | ((uint32_t)a[7] << 10) | ((uint32_t)a[6] << 18);
|
331
|
+
r->n[8] = (uint32_t)a[5] | ((uint32_t)a[4] << 8) | ((uint32_t)a[3] << 16) | ((uint32_t)(a[2] & 0x3) << 24);
|
332
|
+
r->n[9] = (uint32_t)((a[2] >> 2) & 0x3f) | ((uint32_t)a[1] << 6) | ((uint32_t)a[0] << 14);
|
333
|
+
|
334
|
+
if (r->n[9] == 0x3FFFFFUL && (r->n[8] & r->n[7] & r->n[6] & r->n[5] & r->n[4] & r->n[3] & r->n[2]) == 0x3FFFFFFUL && (r->n[1] + 0x40UL + ((r->n[0] + 0x3D1UL) >> 26)) > 0x3FFFFFFUL) {
|
335
|
+
return 0;
|
336
|
+
}
|
337
|
+
#ifdef VERIFY
|
338
|
+
r->magnitude = 1;
|
339
|
+
r->normalized = 1;
|
340
|
+
secp256k1_fe_verify(r);
|
341
|
+
#endif
|
342
|
+
return 1;
|
343
|
+
}
|
344
|
+
|
345
|
+
/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */
|
346
|
+
static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a) {
|
347
|
+
#ifdef VERIFY
|
348
|
+
VERIFY_CHECK(a->normalized);
|
349
|
+
secp256k1_fe_verify(a);
|
350
|
+
#endif
|
351
|
+
r[0] = (a->n[9] >> 14) & 0xff;
|
352
|
+
r[1] = (a->n[9] >> 6) & 0xff;
|
353
|
+
r[2] = ((a->n[9] & 0x3F) << 2) | ((a->n[8] >> 24) & 0x3);
|
354
|
+
r[3] = (a->n[8] >> 16) & 0xff;
|
355
|
+
r[4] = (a->n[8] >> 8) & 0xff;
|
356
|
+
r[5] = a->n[8] & 0xff;
|
357
|
+
r[6] = (a->n[7] >> 18) & 0xff;
|
358
|
+
r[7] = (a->n[7] >> 10) & 0xff;
|
359
|
+
r[8] = (a->n[7] >> 2) & 0xff;
|
360
|
+
r[9] = ((a->n[7] & 0x3) << 6) | ((a->n[6] >> 20) & 0x3f);
|
361
|
+
r[10] = (a->n[6] >> 12) & 0xff;
|
362
|
+
r[11] = (a->n[6] >> 4) & 0xff;
|
363
|
+
r[12] = ((a->n[6] & 0xf) << 4) | ((a->n[5] >> 22) & 0xf);
|
364
|
+
r[13] = (a->n[5] >> 14) & 0xff;
|
365
|
+
r[14] = (a->n[5] >> 6) & 0xff;
|
366
|
+
r[15] = ((a->n[5] & 0x3f) << 2) | ((a->n[4] >> 24) & 0x3);
|
367
|
+
r[16] = (a->n[4] >> 16) & 0xff;
|
368
|
+
r[17] = (a->n[4] >> 8) & 0xff;
|
369
|
+
r[18] = a->n[4] & 0xff;
|
370
|
+
r[19] = (a->n[3] >> 18) & 0xff;
|
371
|
+
r[20] = (a->n[3] >> 10) & 0xff;
|
372
|
+
r[21] = (a->n[3] >> 2) & 0xff;
|
373
|
+
r[22] = ((a->n[3] & 0x3) << 6) | ((a->n[2] >> 20) & 0x3f);
|
374
|
+
r[23] = (a->n[2] >> 12) & 0xff;
|
375
|
+
r[24] = (a->n[2] >> 4) & 0xff;
|
376
|
+
r[25] = ((a->n[2] & 0xf) << 4) | ((a->n[1] >> 22) & 0xf);
|
377
|
+
r[26] = (a->n[1] >> 14) & 0xff;
|
378
|
+
r[27] = (a->n[1] >> 6) & 0xff;
|
379
|
+
r[28] = ((a->n[1] & 0x3f) << 2) | ((a->n[0] >> 24) & 0x3);
|
380
|
+
r[29] = (a->n[0] >> 16) & 0xff;
|
381
|
+
r[30] = (a->n[0] >> 8) & 0xff;
|
382
|
+
r[31] = a->n[0] & 0xff;
|
383
|
+
}
|
384
|
+
|
385
|
+
SECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m) {
|
386
|
+
#ifdef VERIFY
|
387
|
+
VERIFY_CHECK(a->magnitude <= m);
|
388
|
+
secp256k1_fe_verify(a);
|
389
|
+
#endif
|
390
|
+
r->n[0] = 0x3FFFC2FUL * 2 * (m + 1) - a->n[0];
|
391
|
+
r->n[1] = 0x3FFFFBFUL * 2 * (m + 1) - a->n[1];
|
392
|
+
r->n[2] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[2];
|
393
|
+
r->n[3] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[3];
|
394
|
+
r->n[4] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[4];
|
395
|
+
r->n[5] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[5];
|
396
|
+
r->n[6] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[6];
|
397
|
+
r->n[7] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[7];
|
398
|
+
r->n[8] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[8];
|
399
|
+
r->n[9] = 0x03FFFFFUL * 2 * (m + 1) - a->n[9];
|
400
|
+
#ifdef VERIFY
|
401
|
+
r->magnitude = m + 1;
|
402
|
+
r->normalized = 0;
|
403
|
+
secp256k1_fe_verify(r);
|
404
|
+
#endif
|
405
|
+
}
|
406
|
+
|
407
|
+
SECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe *r, int a) {
|
408
|
+
r->n[0] *= a;
|
409
|
+
r->n[1] *= a;
|
410
|
+
r->n[2] *= a;
|
411
|
+
r->n[3] *= a;
|
412
|
+
r->n[4] *= a;
|
413
|
+
r->n[5] *= a;
|
414
|
+
r->n[6] *= a;
|
415
|
+
r->n[7] *= a;
|
416
|
+
r->n[8] *= a;
|
417
|
+
r->n[9] *= a;
|
418
|
+
#ifdef VERIFY
|
419
|
+
r->magnitude *= a;
|
420
|
+
r->normalized = 0;
|
421
|
+
secp256k1_fe_verify(r);
|
422
|
+
#endif
|
423
|
+
}
|
424
|
+
|
425
|
+
SECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a) {
|
426
|
+
#ifdef VERIFY
|
427
|
+
secp256k1_fe_verify(a);
|
428
|
+
#endif
|
429
|
+
r->n[0] += a->n[0];
|
430
|
+
r->n[1] += a->n[1];
|
431
|
+
r->n[2] += a->n[2];
|
432
|
+
r->n[3] += a->n[3];
|
433
|
+
r->n[4] += a->n[4];
|
434
|
+
r->n[5] += a->n[5];
|
435
|
+
r->n[6] += a->n[6];
|
436
|
+
r->n[7] += a->n[7];
|
437
|
+
r->n[8] += a->n[8];
|
438
|
+
r->n[9] += a->n[9];
|
439
|
+
#ifdef VERIFY
|
440
|
+
r->magnitude += a->magnitude;
|
441
|
+
r->normalized = 0;
|
442
|
+
secp256k1_fe_verify(r);
|
443
|
+
#endif
|
444
|
+
}
|
445
|
+
|
446
|
+
#if defined(USE_EXTERNAL_ASM)
|
447
|
+
|
448
|
+
/* External assembler implementation */
|
449
|
+
void secp256k1_fe_mul_inner(uint32_t *r, const uint32_t *a, const uint32_t * SECP256K1_RESTRICT b);
|
450
|
+
void secp256k1_fe_sqr_inner(uint32_t *r, const uint32_t *a);
|
451
|
+
|
452
|
+
#else
|
453
|
+
|
454
|
+
#ifdef VERIFY
|
455
|
+
#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)
|
456
|
+
#else
|
457
|
+
#define VERIFY_BITS(x, n) do { } while(0)
|
458
|
+
#endif
|
459
|
+
|
460
|
+
SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint32_t *r, const uint32_t *a, const uint32_t * SECP256K1_RESTRICT b) {
|
461
|
+
uint64_t c, d;
|
462
|
+
uint64_t u0, u1, u2, u3, u4, u5, u6, u7, u8;
|
463
|
+
uint32_t t9, t1, t0, t2, t3, t4, t5, t6, t7;
|
464
|
+
const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL;
|
465
|
+
|
466
|
+
VERIFY_BITS(a[0], 30);
|
467
|
+
VERIFY_BITS(a[1], 30);
|
468
|
+
VERIFY_BITS(a[2], 30);
|
469
|
+
VERIFY_BITS(a[3], 30);
|
470
|
+
VERIFY_BITS(a[4], 30);
|
471
|
+
VERIFY_BITS(a[5], 30);
|
472
|
+
VERIFY_BITS(a[6], 30);
|
473
|
+
VERIFY_BITS(a[7], 30);
|
474
|
+
VERIFY_BITS(a[8], 30);
|
475
|
+
VERIFY_BITS(a[9], 26);
|
476
|
+
VERIFY_BITS(b[0], 30);
|
477
|
+
VERIFY_BITS(b[1], 30);
|
478
|
+
VERIFY_BITS(b[2], 30);
|
479
|
+
VERIFY_BITS(b[3], 30);
|
480
|
+
VERIFY_BITS(b[4], 30);
|
481
|
+
VERIFY_BITS(b[5], 30);
|
482
|
+
VERIFY_BITS(b[6], 30);
|
483
|
+
VERIFY_BITS(b[7], 30);
|
484
|
+
VERIFY_BITS(b[8], 30);
|
485
|
+
VERIFY_BITS(b[9], 26);
|
486
|
+
|
487
|
+
/** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n.
|
488
|
+
* for 0 <= x <= 9, px is a shorthand for sum(a[i]*b[x-i], i=0..x).
|
489
|
+
* for 9 <= x <= 18, px is a shorthand for sum(a[i]*b[x-i], i=(x-9)..9)
|
490
|
+
* Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].
|
491
|
+
*/
|
492
|
+
|
493
|
+
d = (uint64_t)a[0] * b[9]
|
494
|
+
+ (uint64_t)a[1] * b[8]
|
495
|
+
+ (uint64_t)a[2] * b[7]
|
496
|
+
+ (uint64_t)a[3] * b[6]
|
497
|
+
+ (uint64_t)a[4] * b[5]
|
498
|
+
+ (uint64_t)a[5] * b[4]
|
499
|
+
+ (uint64_t)a[6] * b[3]
|
500
|
+
+ (uint64_t)a[7] * b[2]
|
501
|
+
+ (uint64_t)a[8] * b[1]
|
502
|
+
+ (uint64_t)a[9] * b[0];
|
503
|
+
/* VERIFY_BITS(d, 64); */
|
504
|
+
/* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */
|
505
|
+
t9 = d & M; d >>= 26;
|
506
|
+
VERIFY_BITS(t9, 26);
|
507
|
+
VERIFY_BITS(d, 38);
|
508
|
+
/* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */
|
509
|
+
|
510
|
+
c = (uint64_t)a[0] * b[0];
|
511
|
+
VERIFY_BITS(c, 60);
|
512
|
+
/* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */
|
513
|
+
d += (uint64_t)a[1] * b[9]
|
514
|
+
+ (uint64_t)a[2] * b[8]
|
515
|
+
+ (uint64_t)a[3] * b[7]
|
516
|
+
+ (uint64_t)a[4] * b[6]
|
517
|
+
+ (uint64_t)a[5] * b[5]
|
518
|
+
+ (uint64_t)a[6] * b[4]
|
519
|
+
+ (uint64_t)a[7] * b[3]
|
520
|
+
+ (uint64_t)a[8] * b[2]
|
521
|
+
+ (uint64_t)a[9] * b[1];
|
522
|
+
VERIFY_BITS(d, 63);
|
523
|
+
/* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
524
|
+
u0 = d & M; d >>= 26; c += u0 * R0;
|
525
|
+
VERIFY_BITS(u0, 26);
|
526
|
+
VERIFY_BITS(d, 37);
|
527
|
+
VERIFY_BITS(c, 61);
|
528
|
+
/* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
529
|
+
t0 = c & M; c >>= 26; c += u0 * R1;
|
530
|
+
VERIFY_BITS(t0, 26);
|
531
|
+
VERIFY_BITS(c, 37);
|
532
|
+
/* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
533
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
534
|
+
|
535
|
+
c += (uint64_t)a[0] * b[1]
|
536
|
+
+ (uint64_t)a[1] * b[0];
|
537
|
+
VERIFY_BITS(c, 62);
|
538
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
539
|
+
d += (uint64_t)a[2] * b[9]
|
540
|
+
+ (uint64_t)a[3] * b[8]
|
541
|
+
+ (uint64_t)a[4] * b[7]
|
542
|
+
+ (uint64_t)a[5] * b[6]
|
543
|
+
+ (uint64_t)a[6] * b[5]
|
544
|
+
+ (uint64_t)a[7] * b[4]
|
545
|
+
+ (uint64_t)a[8] * b[3]
|
546
|
+
+ (uint64_t)a[9] * b[2];
|
547
|
+
VERIFY_BITS(d, 63);
|
548
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
549
|
+
u1 = d & M; d >>= 26; c += u1 * R0;
|
550
|
+
VERIFY_BITS(u1, 26);
|
551
|
+
VERIFY_BITS(d, 37);
|
552
|
+
VERIFY_BITS(c, 63);
|
553
|
+
/* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
554
|
+
t1 = c & M; c >>= 26; c += u1 * R1;
|
555
|
+
VERIFY_BITS(t1, 26);
|
556
|
+
VERIFY_BITS(c, 38);
|
557
|
+
/* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
558
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
559
|
+
|
560
|
+
c += (uint64_t)a[0] * b[2]
|
561
|
+
+ (uint64_t)a[1] * b[1]
|
562
|
+
+ (uint64_t)a[2] * b[0];
|
563
|
+
VERIFY_BITS(c, 62);
|
564
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
565
|
+
d += (uint64_t)a[3] * b[9]
|
566
|
+
+ (uint64_t)a[4] * b[8]
|
567
|
+
+ (uint64_t)a[5] * b[7]
|
568
|
+
+ (uint64_t)a[6] * b[6]
|
569
|
+
+ (uint64_t)a[7] * b[5]
|
570
|
+
+ (uint64_t)a[8] * b[4]
|
571
|
+
+ (uint64_t)a[9] * b[3];
|
572
|
+
VERIFY_BITS(d, 63);
|
573
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
574
|
+
u2 = d & M; d >>= 26; c += u2 * R0;
|
575
|
+
VERIFY_BITS(u2, 26);
|
576
|
+
VERIFY_BITS(d, 37);
|
577
|
+
VERIFY_BITS(c, 63);
|
578
|
+
/* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
579
|
+
t2 = c & M; c >>= 26; c += u2 * R1;
|
580
|
+
VERIFY_BITS(t2, 26);
|
581
|
+
VERIFY_BITS(c, 38);
|
582
|
+
/* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
583
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
584
|
+
|
585
|
+
c += (uint64_t)a[0] * b[3]
|
586
|
+
+ (uint64_t)a[1] * b[2]
|
587
|
+
+ (uint64_t)a[2] * b[1]
|
588
|
+
+ (uint64_t)a[3] * b[0];
|
589
|
+
VERIFY_BITS(c, 63);
|
590
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
591
|
+
d += (uint64_t)a[4] * b[9]
|
592
|
+
+ (uint64_t)a[5] * b[8]
|
593
|
+
+ (uint64_t)a[6] * b[7]
|
594
|
+
+ (uint64_t)a[7] * b[6]
|
595
|
+
+ (uint64_t)a[8] * b[5]
|
596
|
+
+ (uint64_t)a[9] * b[4];
|
597
|
+
VERIFY_BITS(d, 63);
|
598
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
599
|
+
u3 = d & M; d >>= 26; c += u3 * R0;
|
600
|
+
VERIFY_BITS(u3, 26);
|
601
|
+
VERIFY_BITS(d, 37);
|
602
|
+
/* VERIFY_BITS(c, 64); */
|
603
|
+
/* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
604
|
+
t3 = c & M; c >>= 26; c += u3 * R1;
|
605
|
+
VERIFY_BITS(t3, 26);
|
606
|
+
VERIFY_BITS(c, 39);
|
607
|
+
/* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
608
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
609
|
+
|
610
|
+
c += (uint64_t)a[0] * b[4]
|
611
|
+
+ (uint64_t)a[1] * b[3]
|
612
|
+
+ (uint64_t)a[2] * b[2]
|
613
|
+
+ (uint64_t)a[3] * b[1]
|
614
|
+
+ (uint64_t)a[4] * b[0];
|
615
|
+
VERIFY_BITS(c, 63);
|
616
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
617
|
+
d += (uint64_t)a[5] * b[9]
|
618
|
+
+ (uint64_t)a[6] * b[8]
|
619
|
+
+ (uint64_t)a[7] * b[7]
|
620
|
+
+ (uint64_t)a[8] * b[6]
|
621
|
+
+ (uint64_t)a[9] * b[5];
|
622
|
+
VERIFY_BITS(d, 62);
|
623
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
624
|
+
u4 = d & M; d >>= 26; c += u4 * R0;
|
625
|
+
VERIFY_BITS(u4, 26);
|
626
|
+
VERIFY_BITS(d, 36);
|
627
|
+
/* VERIFY_BITS(c, 64); */
|
628
|
+
/* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
629
|
+
t4 = c & M; c >>= 26; c += u4 * R1;
|
630
|
+
VERIFY_BITS(t4, 26);
|
631
|
+
VERIFY_BITS(c, 39);
|
632
|
+
/* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
633
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
634
|
+
|
635
|
+
c += (uint64_t)a[0] * b[5]
|
636
|
+
+ (uint64_t)a[1] * b[4]
|
637
|
+
+ (uint64_t)a[2] * b[3]
|
638
|
+
+ (uint64_t)a[3] * b[2]
|
639
|
+
+ (uint64_t)a[4] * b[1]
|
640
|
+
+ (uint64_t)a[5] * b[0];
|
641
|
+
VERIFY_BITS(c, 63);
|
642
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
643
|
+
d += (uint64_t)a[6] * b[9]
|
644
|
+
+ (uint64_t)a[7] * b[8]
|
645
|
+
+ (uint64_t)a[8] * b[7]
|
646
|
+
+ (uint64_t)a[9] * b[6];
|
647
|
+
VERIFY_BITS(d, 62);
|
648
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
649
|
+
u5 = d & M; d >>= 26; c += u5 * R0;
|
650
|
+
VERIFY_BITS(u5, 26);
|
651
|
+
VERIFY_BITS(d, 36);
|
652
|
+
/* VERIFY_BITS(c, 64); */
|
653
|
+
/* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
654
|
+
t5 = c & M; c >>= 26; c += u5 * R1;
|
655
|
+
VERIFY_BITS(t5, 26);
|
656
|
+
VERIFY_BITS(c, 39);
|
657
|
+
/* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
658
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
659
|
+
|
660
|
+
c += (uint64_t)a[0] * b[6]
|
661
|
+
+ (uint64_t)a[1] * b[5]
|
662
|
+
+ (uint64_t)a[2] * b[4]
|
663
|
+
+ (uint64_t)a[3] * b[3]
|
664
|
+
+ (uint64_t)a[4] * b[2]
|
665
|
+
+ (uint64_t)a[5] * b[1]
|
666
|
+
+ (uint64_t)a[6] * b[0];
|
667
|
+
VERIFY_BITS(c, 63);
|
668
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
669
|
+
d += (uint64_t)a[7] * b[9]
|
670
|
+
+ (uint64_t)a[8] * b[8]
|
671
|
+
+ (uint64_t)a[9] * b[7];
|
672
|
+
VERIFY_BITS(d, 61);
|
673
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
674
|
+
u6 = d & M; d >>= 26; c += u6 * R0;
|
675
|
+
VERIFY_BITS(u6, 26);
|
676
|
+
VERIFY_BITS(d, 35);
|
677
|
+
/* VERIFY_BITS(c, 64); */
|
678
|
+
/* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
679
|
+
t6 = c & M; c >>= 26; c += u6 * R1;
|
680
|
+
VERIFY_BITS(t6, 26);
|
681
|
+
VERIFY_BITS(c, 39);
|
682
|
+
/* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
683
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
684
|
+
|
685
|
+
c += (uint64_t)a[0] * b[7]
|
686
|
+
+ (uint64_t)a[1] * b[6]
|
687
|
+
+ (uint64_t)a[2] * b[5]
|
688
|
+
+ (uint64_t)a[3] * b[4]
|
689
|
+
+ (uint64_t)a[4] * b[3]
|
690
|
+
+ (uint64_t)a[5] * b[2]
|
691
|
+
+ (uint64_t)a[6] * b[1]
|
692
|
+
+ (uint64_t)a[7] * b[0];
|
693
|
+
/* VERIFY_BITS(c, 64); */
|
694
|
+
VERIFY_CHECK(c <= 0x8000007C00000007ULL);
|
695
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
696
|
+
d += (uint64_t)a[8] * b[9]
|
697
|
+
+ (uint64_t)a[9] * b[8];
|
698
|
+
VERIFY_BITS(d, 58);
|
699
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
700
|
+
u7 = d & M; d >>= 26; c += u7 * R0;
|
701
|
+
VERIFY_BITS(u7, 26);
|
702
|
+
VERIFY_BITS(d, 32);
|
703
|
+
/* VERIFY_BITS(c, 64); */
|
704
|
+
VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL);
|
705
|
+
/* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
706
|
+
t7 = c & M; c >>= 26; c += u7 * R1;
|
707
|
+
VERIFY_BITS(t7, 26);
|
708
|
+
VERIFY_BITS(c, 38);
|
709
|
+
/* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
710
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
711
|
+
|
712
|
+
c += (uint64_t)a[0] * b[8]
|
713
|
+
+ (uint64_t)a[1] * b[7]
|
714
|
+
+ (uint64_t)a[2] * b[6]
|
715
|
+
+ (uint64_t)a[3] * b[5]
|
716
|
+
+ (uint64_t)a[4] * b[4]
|
717
|
+
+ (uint64_t)a[5] * b[3]
|
718
|
+
+ (uint64_t)a[6] * b[2]
|
719
|
+
+ (uint64_t)a[7] * b[1]
|
720
|
+
+ (uint64_t)a[8] * b[0];
|
721
|
+
/* VERIFY_BITS(c, 64); */
|
722
|
+
VERIFY_CHECK(c <= 0x9000007B80000008ULL);
|
723
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
724
|
+
d += (uint64_t)a[9] * b[9];
|
725
|
+
VERIFY_BITS(d, 57);
|
726
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
727
|
+
u8 = d & M; d >>= 26; c += u8 * R0;
|
728
|
+
VERIFY_BITS(u8, 26);
|
729
|
+
VERIFY_BITS(d, 31);
|
730
|
+
/* VERIFY_BITS(c, 64); */
|
731
|
+
VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL);
|
732
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
733
|
+
|
734
|
+
r[3] = t3;
|
735
|
+
VERIFY_BITS(r[3], 26);
|
736
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
737
|
+
r[4] = t4;
|
738
|
+
VERIFY_BITS(r[4], 26);
|
739
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
740
|
+
r[5] = t5;
|
741
|
+
VERIFY_BITS(r[5], 26);
|
742
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
743
|
+
r[6] = t6;
|
744
|
+
VERIFY_BITS(r[6], 26);
|
745
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
746
|
+
r[7] = t7;
|
747
|
+
VERIFY_BITS(r[7], 26);
|
748
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
749
|
+
|
750
|
+
r[8] = c & M; c >>= 26; c += u8 * R1;
|
751
|
+
VERIFY_BITS(r[8], 26);
|
752
|
+
VERIFY_BITS(c, 39);
|
753
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
754
|
+
/* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
755
|
+
c += d * R0 + t9;
|
756
|
+
VERIFY_BITS(c, 45);
|
757
|
+
/* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
758
|
+
r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4);
|
759
|
+
VERIFY_BITS(r[9], 22);
|
760
|
+
VERIFY_BITS(c, 46);
|
761
|
+
/* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
762
|
+
/* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
763
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
764
|
+
|
765
|
+
d = c * (R0 >> 4) + t0;
|
766
|
+
VERIFY_BITS(d, 56);
|
767
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
768
|
+
r[0] = d & M; d >>= 26;
|
769
|
+
VERIFY_BITS(r[0], 26);
|
770
|
+
VERIFY_BITS(d, 30);
|
771
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
772
|
+
d += c * (R1 >> 4) + t1;
|
773
|
+
VERIFY_BITS(d, 53);
|
774
|
+
VERIFY_CHECK(d <= 0x10000003FFFFBFULL);
|
775
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
776
|
+
/* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
777
|
+
r[1] = d & M; d >>= 26;
|
778
|
+
VERIFY_BITS(r[1], 26);
|
779
|
+
VERIFY_BITS(d, 27);
|
780
|
+
VERIFY_CHECK(d <= 0x4000000ULL);
|
781
|
+
/* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
782
|
+
d += t2;
|
783
|
+
VERIFY_BITS(d, 27);
|
784
|
+
/* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
785
|
+
r[2] = d;
|
786
|
+
VERIFY_BITS(r[2], 27);
|
787
|
+
/* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
788
|
+
}
|
789
|
+
|
790
|
+
SECP256K1_INLINE static void secp256k1_fe_sqr_inner(uint32_t *r, const uint32_t *a) {
|
791
|
+
uint64_t c, d;
|
792
|
+
uint64_t u0, u1, u2, u3, u4, u5, u6, u7, u8;
|
793
|
+
uint32_t t9, t0, t1, t2, t3, t4, t5, t6, t7;
|
794
|
+
const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL;
|
795
|
+
|
796
|
+
VERIFY_BITS(a[0], 30);
|
797
|
+
VERIFY_BITS(a[1], 30);
|
798
|
+
VERIFY_BITS(a[2], 30);
|
799
|
+
VERIFY_BITS(a[3], 30);
|
800
|
+
VERIFY_BITS(a[4], 30);
|
801
|
+
VERIFY_BITS(a[5], 30);
|
802
|
+
VERIFY_BITS(a[6], 30);
|
803
|
+
VERIFY_BITS(a[7], 30);
|
804
|
+
VERIFY_BITS(a[8], 30);
|
805
|
+
VERIFY_BITS(a[9], 26);
|
806
|
+
|
807
|
+
/** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n.
|
808
|
+
* px is a shorthand for sum(a[i]*a[x-i], i=0..x).
|
809
|
+
* Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].
|
810
|
+
*/
|
811
|
+
|
812
|
+
d = (uint64_t)(a[0]*2) * a[9]
|
813
|
+
+ (uint64_t)(a[1]*2) * a[8]
|
814
|
+
+ (uint64_t)(a[2]*2) * a[7]
|
815
|
+
+ (uint64_t)(a[3]*2) * a[6]
|
816
|
+
+ (uint64_t)(a[4]*2) * a[5];
|
817
|
+
/* VERIFY_BITS(d, 64); */
|
818
|
+
/* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */
|
819
|
+
t9 = d & M; d >>= 26;
|
820
|
+
VERIFY_BITS(t9, 26);
|
821
|
+
VERIFY_BITS(d, 38);
|
822
|
+
/* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */
|
823
|
+
|
824
|
+
c = (uint64_t)a[0] * a[0];
|
825
|
+
VERIFY_BITS(c, 60);
|
826
|
+
/* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */
|
827
|
+
d += (uint64_t)(a[1]*2) * a[9]
|
828
|
+
+ (uint64_t)(a[2]*2) * a[8]
|
829
|
+
+ (uint64_t)(a[3]*2) * a[7]
|
830
|
+
+ (uint64_t)(a[4]*2) * a[6]
|
831
|
+
+ (uint64_t)a[5] * a[5];
|
832
|
+
VERIFY_BITS(d, 63);
|
833
|
+
/* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
834
|
+
u0 = d & M; d >>= 26; c += u0 * R0;
|
835
|
+
VERIFY_BITS(u0, 26);
|
836
|
+
VERIFY_BITS(d, 37);
|
837
|
+
VERIFY_BITS(c, 61);
|
838
|
+
/* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
839
|
+
t0 = c & M; c >>= 26; c += u0 * R1;
|
840
|
+
VERIFY_BITS(t0, 26);
|
841
|
+
VERIFY_BITS(c, 37);
|
842
|
+
/* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
843
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */
|
844
|
+
|
845
|
+
c += (uint64_t)(a[0]*2) * a[1];
|
846
|
+
VERIFY_BITS(c, 62);
|
847
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
848
|
+
d += (uint64_t)(a[2]*2) * a[9]
|
849
|
+
+ (uint64_t)(a[3]*2) * a[8]
|
850
|
+
+ (uint64_t)(a[4]*2) * a[7]
|
851
|
+
+ (uint64_t)(a[5]*2) * a[6];
|
852
|
+
VERIFY_BITS(d, 63);
|
853
|
+
/* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
854
|
+
u1 = d & M; d >>= 26; c += u1 * R0;
|
855
|
+
VERIFY_BITS(u1, 26);
|
856
|
+
VERIFY_BITS(d, 37);
|
857
|
+
VERIFY_BITS(c, 63);
|
858
|
+
/* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
859
|
+
t1 = c & M; c >>= 26; c += u1 * R1;
|
860
|
+
VERIFY_BITS(t1, 26);
|
861
|
+
VERIFY_BITS(c, 38);
|
862
|
+
/* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
863
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */
|
864
|
+
|
865
|
+
c += (uint64_t)(a[0]*2) * a[2]
|
866
|
+
+ (uint64_t)a[1] * a[1];
|
867
|
+
VERIFY_BITS(c, 62);
|
868
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
869
|
+
d += (uint64_t)(a[3]*2) * a[9]
|
870
|
+
+ (uint64_t)(a[4]*2) * a[8]
|
871
|
+
+ (uint64_t)(a[5]*2) * a[7]
|
872
|
+
+ (uint64_t)a[6] * a[6];
|
873
|
+
VERIFY_BITS(d, 63);
|
874
|
+
/* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
875
|
+
u2 = d & M; d >>= 26; c += u2 * R0;
|
876
|
+
VERIFY_BITS(u2, 26);
|
877
|
+
VERIFY_BITS(d, 37);
|
878
|
+
VERIFY_BITS(c, 63);
|
879
|
+
/* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
880
|
+
t2 = c & M; c >>= 26; c += u2 * R1;
|
881
|
+
VERIFY_BITS(t2, 26);
|
882
|
+
VERIFY_BITS(c, 38);
|
883
|
+
/* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
884
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */
|
885
|
+
|
886
|
+
c += (uint64_t)(a[0]*2) * a[3]
|
887
|
+
+ (uint64_t)(a[1]*2) * a[2];
|
888
|
+
VERIFY_BITS(c, 63);
|
889
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
890
|
+
d += (uint64_t)(a[4]*2) * a[9]
|
891
|
+
+ (uint64_t)(a[5]*2) * a[8]
|
892
|
+
+ (uint64_t)(a[6]*2) * a[7];
|
893
|
+
VERIFY_BITS(d, 63);
|
894
|
+
/* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
895
|
+
u3 = d & M; d >>= 26; c += u3 * R0;
|
896
|
+
VERIFY_BITS(u3, 26);
|
897
|
+
VERIFY_BITS(d, 37);
|
898
|
+
/* VERIFY_BITS(c, 64); */
|
899
|
+
/* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
900
|
+
t3 = c & M; c >>= 26; c += u3 * R1;
|
901
|
+
VERIFY_BITS(t3, 26);
|
902
|
+
VERIFY_BITS(c, 39);
|
903
|
+
/* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
904
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */
|
905
|
+
|
906
|
+
c += (uint64_t)(a[0]*2) * a[4]
|
907
|
+
+ (uint64_t)(a[1]*2) * a[3]
|
908
|
+
+ (uint64_t)a[2] * a[2];
|
909
|
+
VERIFY_BITS(c, 63);
|
910
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
911
|
+
d += (uint64_t)(a[5]*2) * a[9]
|
912
|
+
+ (uint64_t)(a[6]*2) * a[8]
|
913
|
+
+ (uint64_t)a[7] * a[7];
|
914
|
+
VERIFY_BITS(d, 62);
|
915
|
+
/* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
916
|
+
u4 = d & M; d >>= 26; c += u4 * R0;
|
917
|
+
VERIFY_BITS(u4, 26);
|
918
|
+
VERIFY_BITS(d, 36);
|
919
|
+
/* VERIFY_BITS(c, 64); */
|
920
|
+
/* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
921
|
+
t4 = c & M; c >>= 26; c += u4 * R1;
|
922
|
+
VERIFY_BITS(t4, 26);
|
923
|
+
VERIFY_BITS(c, 39);
|
924
|
+
/* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
925
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */
|
926
|
+
|
927
|
+
c += (uint64_t)(a[0]*2) * a[5]
|
928
|
+
+ (uint64_t)(a[1]*2) * a[4]
|
929
|
+
+ (uint64_t)(a[2]*2) * a[3];
|
930
|
+
VERIFY_BITS(c, 63);
|
931
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
932
|
+
d += (uint64_t)(a[6]*2) * a[9]
|
933
|
+
+ (uint64_t)(a[7]*2) * a[8];
|
934
|
+
VERIFY_BITS(d, 62);
|
935
|
+
/* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
936
|
+
u5 = d & M; d >>= 26; c += u5 * R0;
|
937
|
+
VERIFY_BITS(u5, 26);
|
938
|
+
VERIFY_BITS(d, 36);
|
939
|
+
/* VERIFY_BITS(c, 64); */
|
940
|
+
/* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
941
|
+
t5 = c & M; c >>= 26; c += u5 * R1;
|
942
|
+
VERIFY_BITS(t5, 26);
|
943
|
+
VERIFY_BITS(c, 39);
|
944
|
+
/* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
945
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */
|
946
|
+
|
947
|
+
c += (uint64_t)(a[0]*2) * a[6]
|
948
|
+
+ (uint64_t)(a[1]*2) * a[5]
|
949
|
+
+ (uint64_t)(a[2]*2) * a[4]
|
950
|
+
+ (uint64_t)a[3] * a[3];
|
951
|
+
VERIFY_BITS(c, 63);
|
952
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
953
|
+
d += (uint64_t)(a[7]*2) * a[9]
|
954
|
+
+ (uint64_t)a[8] * a[8];
|
955
|
+
VERIFY_BITS(d, 61);
|
956
|
+
/* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
957
|
+
u6 = d & M; d >>= 26; c += u6 * R0;
|
958
|
+
VERIFY_BITS(u6, 26);
|
959
|
+
VERIFY_BITS(d, 35);
|
960
|
+
/* VERIFY_BITS(c, 64); */
|
961
|
+
/* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
962
|
+
t6 = c & M; c >>= 26; c += u6 * R1;
|
963
|
+
VERIFY_BITS(t6, 26);
|
964
|
+
VERIFY_BITS(c, 39);
|
965
|
+
/* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
966
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */
|
967
|
+
|
968
|
+
c += (uint64_t)(a[0]*2) * a[7]
|
969
|
+
+ (uint64_t)(a[1]*2) * a[6]
|
970
|
+
+ (uint64_t)(a[2]*2) * a[5]
|
971
|
+
+ (uint64_t)(a[3]*2) * a[4];
|
972
|
+
/* VERIFY_BITS(c, 64); */
|
973
|
+
VERIFY_CHECK(c <= 0x8000007C00000007ULL);
|
974
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
975
|
+
d += (uint64_t)(a[8]*2) * a[9];
|
976
|
+
VERIFY_BITS(d, 58);
|
977
|
+
/* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
978
|
+
u7 = d & M; d >>= 26; c += u7 * R0;
|
979
|
+
VERIFY_BITS(u7, 26);
|
980
|
+
VERIFY_BITS(d, 32);
|
981
|
+
/* VERIFY_BITS(c, 64); */
|
982
|
+
VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL);
|
983
|
+
/* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
984
|
+
t7 = c & M; c >>= 26; c += u7 * R1;
|
985
|
+
VERIFY_BITS(t7, 26);
|
986
|
+
VERIFY_BITS(c, 38);
|
987
|
+
/* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
988
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */
|
989
|
+
|
990
|
+
c += (uint64_t)(a[0]*2) * a[8]
|
991
|
+
+ (uint64_t)(a[1]*2) * a[7]
|
992
|
+
+ (uint64_t)(a[2]*2) * a[6]
|
993
|
+
+ (uint64_t)(a[3]*2) * a[5]
|
994
|
+
+ (uint64_t)a[4] * a[4];
|
995
|
+
/* VERIFY_BITS(c, 64); */
|
996
|
+
VERIFY_CHECK(c <= 0x9000007B80000008ULL);
|
997
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
998
|
+
d += (uint64_t)a[9] * a[9];
|
999
|
+
VERIFY_BITS(d, 57);
|
1000
|
+
/* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1001
|
+
u8 = d & M; d >>= 26; c += u8 * R0;
|
1002
|
+
VERIFY_BITS(u8, 26);
|
1003
|
+
VERIFY_BITS(d, 31);
|
1004
|
+
/* VERIFY_BITS(c, 64); */
|
1005
|
+
VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL);
|
1006
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1007
|
+
|
1008
|
+
r[3] = t3;
|
1009
|
+
VERIFY_BITS(r[3], 26);
|
1010
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1011
|
+
r[4] = t4;
|
1012
|
+
VERIFY_BITS(r[4], 26);
|
1013
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1014
|
+
r[5] = t5;
|
1015
|
+
VERIFY_BITS(r[5], 26);
|
1016
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1017
|
+
r[6] = t6;
|
1018
|
+
VERIFY_BITS(r[6], 26);
|
1019
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1020
|
+
r[7] = t7;
|
1021
|
+
VERIFY_BITS(r[7], 26);
|
1022
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1023
|
+
|
1024
|
+
r[8] = c & M; c >>= 26; c += u8 * R1;
|
1025
|
+
VERIFY_BITS(r[8], 26);
|
1026
|
+
VERIFY_BITS(c, 39);
|
1027
|
+
/* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1028
|
+
/* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1029
|
+
c += d * R0 + t9;
|
1030
|
+
VERIFY_BITS(c, 45);
|
1031
|
+
/* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1032
|
+
r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4);
|
1033
|
+
VERIFY_BITS(r[9], 22);
|
1034
|
+
VERIFY_BITS(c, 46);
|
1035
|
+
/* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1036
|
+
/* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1037
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1038
|
+
|
1039
|
+
d = c * (R0 >> 4) + t0;
|
1040
|
+
VERIFY_BITS(d, 56);
|
1041
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1042
|
+
r[0] = d & M; d >>= 26;
|
1043
|
+
VERIFY_BITS(r[0], 26);
|
1044
|
+
VERIFY_BITS(d, 30);
|
1045
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1046
|
+
d += c * (R1 >> 4) + t1;
|
1047
|
+
VERIFY_BITS(d, 53);
|
1048
|
+
VERIFY_CHECK(d <= 0x10000003FFFFBFULL);
|
1049
|
+
/* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1050
|
+
/* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1051
|
+
r[1] = d & M; d >>= 26;
|
1052
|
+
VERIFY_BITS(r[1], 26);
|
1053
|
+
VERIFY_BITS(d, 27);
|
1054
|
+
VERIFY_CHECK(d <= 0x4000000ULL);
|
1055
|
+
/* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1056
|
+
d += t2;
|
1057
|
+
VERIFY_BITS(d, 27);
|
1058
|
+
/* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1059
|
+
r[2] = d;
|
1060
|
+
VERIFY_BITS(r[2], 27);
|
1061
|
+
/* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */
|
1062
|
+
}
|
1063
|
+
#endif
|
1064
|
+
|
1065
|
+
static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
|
1066
|
+
#ifdef VERIFY
|
1067
|
+
VERIFY_CHECK(a->magnitude <= 8);
|
1068
|
+
VERIFY_CHECK(b->magnitude <= 8);
|
1069
|
+
secp256k1_fe_verify(a);
|
1070
|
+
secp256k1_fe_verify(b);
|
1071
|
+
VERIFY_CHECK(r != b);
|
1072
|
+
VERIFY_CHECK(a != b);
|
1073
|
+
#endif
|
1074
|
+
secp256k1_fe_mul_inner(r->n, a->n, b->n);
|
1075
|
+
#ifdef VERIFY
|
1076
|
+
r->magnitude = 1;
|
1077
|
+
r->normalized = 0;
|
1078
|
+
secp256k1_fe_verify(r);
|
1079
|
+
#endif
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
static void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
|
1083
|
+
#ifdef VERIFY
|
1084
|
+
VERIFY_CHECK(a->magnitude <= 8);
|
1085
|
+
secp256k1_fe_verify(a);
|
1086
|
+
#endif
|
1087
|
+
secp256k1_fe_sqr_inner(r->n, a->n);
|
1088
|
+
#ifdef VERIFY
|
1089
|
+
r->magnitude = 1;
|
1090
|
+
r->normalized = 0;
|
1091
|
+
secp256k1_fe_verify(r);
|
1092
|
+
#endif
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
static SECP256K1_INLINE void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {
|
1096
|
+
uint32_t mask0, mask1;
|
1097
|
+
mask0 = flag + ~((uint32_t)0);
|
1098
|
+
mask1 = ~mask0;
|
1099
|
+
r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
|
1100
|
+
r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
|
1101
|
+
r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
|
1102
|
+
r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
|
1103
|
+
r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);
|
1104
|
+
r->n[5] = (r->n[5] & mask0) | (a->n[5] & mask1);
|
1105
|
+
r->n[6] = (r->n[6] & mask0) | (a->n[6] & mask1);
|
1106
|
+
r->n[7] = (r->n[7] & mask0) | (a->n[7] & mask1);
|
1107
|
+
r->n[8] = (r->n[8] & mask0) | (a->n[8] & mask1);
|
1108
|
+
r->n[9] = (r->n[9] & mask0) | (a->n[9] & mask1);
|
1109
|
+
#ifdef VERIFY
|
1110
|
+
if (a->magnitude > r->magnitude) {
|
1111
|
+
r->magnitude = a->magnitude;
|
1112
|
+
}
|
1113
|
+
r->normalized &= a->normalized;
|
1114
|
+
#endif
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
static SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {
|
1118
|
+
uint32_t mask0, mask1;
|
1119
|
+
mask0 = flag + ~((uint32_t)0);
|
1120
|
+
mask1 = ~mask0;
|
1121
|
+
r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
|
1122
|
+
r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
|
1123
|
+
r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
|
1124
|
+
r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
|
1125
|
+
r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);
|
1126
|
+
r->n[5] = (r->n[5] & mask0) | (a->n[5] & mask1);
|
1127
|
+
r->n[6] = (r->n[6] & mask0) | (a->n[6] & mask1);
|
1128
|
+
r->n[7] = (r->n[7] & mask0) | (a->n[7] & mask1);
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
static void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {
|
1132
|
+
#ifdef VERIFY
|
1133
|
+
VERIFY_CHECK(a->normalized);
|
1134
|
+
#endif
|
1135
|
+
r->n[0] = a->n[0] | a->n[1] << 26;
|
1136
|
+
r->n[1] = a->n[1] >> 6 | a->n[2] << 20;
|
1137
|
+
r->n[2] = a->n[2] >> 12 | a->n[3] << 14;
|
1138
|
+
r->n[3] = a->n[3] >> 18 | a->n[4] << 8;
|
1139
|
+
r->n[4] = a->n[4] >> 24 | a->n[5] << 2 | a->n[6] << 28;
|
1140
|
+
r->n[5] = a->n[6] >> 4 | a->n[7] << 22;
|
1141
|
+
r->n[6] = a->n[7] >> 10 | a->n[8] << 16;
|
1142
|
+
r->n[7] = a->n[8] >> 16 | a->n[9] << 10;
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
static SECP256K1_INLINE void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
|
1146
|
+
r->n[0] = a->n[0] & 0x3FFFFFFUL;
|
1147
|
+
r->n[1] = a->n[0] >> 26 | ((a->n[1] << 6) & 0x3FFFFFFUL);
|
1148
|
+
r->n[2] = a->n[1] >> 20 | ((a->n[2] << 12) & 0x3FFFFFFUL);
|
1149
|
+
r->n[3] = a->n[2] >> 14 | ((a->n[3] << 18) & 0x3FFFFFFUL);
|
1150
|
+
r->n[4] = a->n[3] >> 8 | ((a->n[4] << 24) & 0x3FFFFFFUL);
|
1151
|
+
r->n[5] = (a->n[4] >> 2) & 0x3FFFFFFUL;
|
1152
|
+
r->n[6] = a->n[4] >> 28 | ((a->n[5] << 4) & 0x3FFFFFFUL);
|
1153
|
+
r->n[7] = a->n[5] >> 22 | ((a->n[6] << 10) & 0x3FFFFFFUL);
|
1154
|
+
r->n[8] = a->n[6] >> 16 | ((a->n[7] << 16) & 0x3FFFFFFUL);
|
1155
|
+
r->n[9] = a->n[7] >> 10;
|
1156
|
+
#ifdef VERIFY
|
1157
|
+
r->magnitude = 1;
|
1158
|
+
r->normalized = 1;
|
1159
|
+
#endif
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
#endif /* SECP256K1_FIELD_REPR_IMPL_H */
|