51 Commits
Author SHA1 Message Date
Jaco 7689afb616 Add secp256k1 interfaces (#241)
* Add secp256k1 functions

* features for rand

* JS tests

* signing

* CHANGELOG

* Add secp256k1 seed
2021-12-02 14:19:33 +02:00
Jaco d5512418d2 Use stable as nightly compiler (#192)
* Use stable as nightly compiler

* detect stable

* Apply suggestions from code review

* CHANGELOG

* De-dupe Rust version

* Adjust script location

* Script cleanups

* trigger

* Script location
2021-08-25 11:55:17 +02:00
Jaco cf20e027af Single module bundle via rollup (#203)
* Single module bundle via rollup

* Adjust naming

* Allow multiple bundles (consistency)

* Remove unused rollup plugins

* Update rollup.config.js

* preferConst

* Rollup with dev build

* Use createBundle

* Update rollup.config.mjs

* Add bundle entrypoint

* Bump dev

* Bump dev

* Remove x-* overrides
2021-07-07 17:34:32 +02:00
Jaco Greeff 25d9e21b38 Adjust esm -> cjs imports (4.0.2) (#185)
* Adjust esm -> cjs impors

* cleanups

* CHANGELOG

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update packages/wasm-crypto-wasm/src/empty.ts

* Apply suggestions from code review

* Update packages/wasm-crypto-wasm/src/cjs/bytes.d.ts
2021-03-05 22:55:19 +01:00
Jaco Greeff 641ea0f9d8 Small cleanups (#182)
* Small cleanups

* Detect wasm-crypt-* alongside detectPackage

* Adjust alias imports

* Adjust

* Adjust
2021-03-04 17:59:38 +01:00
Jaco Greeff 0f6e143a6f Default build to type: module (#180)
* Defaul build to type: module

* Add packageInfo

* 4.0

* pre

* Adjust tests

* jest js, rest cjs

* Bump dev
2021-03-02 17:27:41 +01:00
Jaco Greeff 63622edcf4 Cleanup implicit dependencies, perform base64 decoding using base64-js (#178)
* Cleanup implicit dependencies, perform base64 decoding using base64-js

* base64 decoding

* lint

* remove extra call

* adjust
2021-02-24 17:09:06 +01:00
Jaco Greeff 8510120701 Bumps (#173)
* Bumps

* Update fflate imports
2021-01-21 12:59:06 +01:00
Jaco Greeff 1bb6db86f7 2021 (#167) 2021-01-03 11:20:26 +01:00
Jaco Greeff 3c13f266df Bundle unzlibSync (no worker requirement, stop-gap) (#162)
* Bundle unzlibSync (no worker requirement, stop-gap)

* Bump deps

* Pass uncompressedSize

* mjs fixes
2020-12-19 11:24:59 +01:00
Jaco Greeff 2c4f8bbe4e 3.0 (#158)
* 3.0

* CHANGELOG

* Rename content packages

* final dev bump
2020-12-13 10:09:24 +01:00
Jaco Greeff 8837ec9386 Use lz4 on the WASM stream (#159)
* Use lz4 on the WASM stream

* Allow fflate tree-shaking

* Rewrite deps
2020-12-12 13:09:47 +01:00
Jaco Greeff 3e1249ca2c Allow esm builds (#157) 2020-12-11 16:45:56 +01:00
Jaco Greeff 45b51adfc7 Build esm (don't use) (#156) 2020-12-10 16:59:50 +01:00
Jaco Greeff 5c563bb95f Split bytes packages for easier override (#155) 2020-12-10 14:07:11 +01:00
Jaco Greeff ad4ac2e101 Convert to TypeScript sources (#152) 2020-12-09 15:52:04 +01:00
Jaco Greeff 2fca9b83c1 Flatten JS (#142)
* Flatten JS

* JS locations in build
2020-11-07 14:18:41 +01:00
Jaco Greeff 141f5e6488 Fix binaryen binaries (mac with shared libs) (#137) 2020-11-05 14:47:38 +01:00
Jaco Greeff ae748a828d Build via xargo (#136)
* Build via xargo

* xargo as dev dep

* Install xargo explicitly

* Fix binaryen dep

* Update deps

* Remove unused wasm-pack section

* Uname
2020-11-05 14:23:27 +01:00
Jaco Greeff 1d7addf6ef Remove auto-injected crypto polyfill (#132)
* Remove auto-injected crypto polyfill

* Update
2020-11-02 21:17:11 +01:00
Jaco Greeff bb748c0225 Simplify asm creation (#131) 2020-11-02 19:02:28 +01:00
Jaco Greeff e2d0726608 Split js/wasm (#130)
* Split js/wasm

* require
2020-11-02 18:34:00 +01:00
Jaco Greeff da946b18ce Cleanup build, no sed mangling (#129)
* Polyfill require adjust

* Assert in promise for getRandomBytes

* Adjust jest

* Revert explicit overrides (from base)

* use typeof

* Re-add crypto-polyfill (backwards, direct imports)

* crypto log

* Fix dev

* Adjust

* Cleanups, no sed mangling

* Cleanup build folder

* Remove exports

* Cleanups

* Adjust env vs util

* Remove Buffer alloc

* Cleant ext vs int

* Rework naming

* Mapping rename

* Combine index & exports

* withWasm wrapper

* pass{String, U8a} -> alloc{String, U8a}

* Internal reuse

* Explict package-only test
2020-11-02 16:39:54 +01:00
Jaco Greeff 83762d9997 Polyfill require adjust (#128)
* Polyfill require adjust

* Assert in promise for getRandomBytes

* Adjust jest

* Revert explicit overrides (from base)

* use typeof

* Re-add crypto-polyfill (backwards, direct imports)

* crypto log

* Fix dev

* Adjust
2020-11-01 18:53:09 +01:00
Jaco Greeff b3ae90f330 Stick to base64 2020-10-27 09:23:46 +01:00
Jaco Greeff 35b2bb2d13 Use base122 encoding for WASM buffer (#127) 2020-10-27 09:04:37 +01:00
Jaco Greeff 29ab5f2e50 Swap to stable Rustc (non-nightly) (#118)
* Swap to stable Rustc (non-nightly)

* Remove toolchain?

* cargo run?
2020-10-15 12:42:50 +02:00
Jaco Greeff 52c5a506ac SPDX (#114) 2020-09-17 16:13:19 +02:00
Jaco Greeff 7ee706a99f Bump berry (#96)
* Bump berry

* Rewrite
2020-08-06 14:00:58 +02:00
Jaco Greeff f50d6af2bb Updates for latest wasm-pack formats (#91)
* Updates for latest wasm-pack formats

* Cleanup sed output
2020-08-03 13:57:34 +02:00
Jaco Greeff 9bc97a4e1d Update ed25519-dalek (#85)
* Update ed25519-dalek

* Bump subtle
2020-07-17 13:12:21 +02:00
Jaco Greeff 8c0aa030cf Bump deps (#79)
* Bump deps

* Rust bumps

* Rust bumps (again)

* Pin nightly

* Cleanup with new generation
2020-05-23 18:25:53 +02:00
Jaco Greeff 3ef1b2073f Add yarn matrix (#70) 2020-03-16 15:31:06 +01:00
Jaco Greeff a20b14a8b7 Use yarn pnp (#64)
* Use yarn pnp

* Bump dev

* Bumps

* Attempt to fix build

* Move "override-require": "^1.1.1" dep

* Bump
2020-03-04 13:26:56 +01:00
Jaco Greeff a9b2ac1240 Swap to yarn 2 (#58)
* Swap to yarn 2

* Use polkadot-dev-run-test for jest

* Try and fix JS tests via jest

* Try via @polkadot/dev
2020-02-28 12:58:57 +01:00
Jaco Greeff c976f3ebf9 Use binaryen from GH releases (Linux) (#57)
* Use binaryen from GH releases (Linux)

* echo for downloading
2020-02-26 22:12:17 +01:00
Jaco Greeff 57030cb591 Unpin nightly (#56) 2020-02-25 11:29:10 +01:00
Jaco Greeff 4c7a9609bd Drop sr25519 verify_simple_preaudit_deprecated (#54)
* Drop sr25519 verify_simple_preaudit_deprecated

* Add missing Signature import

* Update test-verctor, 0.8.5+ only signatures

* Trigger

* Pin Rust nightly

* Pin via run

* De-dup nightlies

* Update tests to use nightly-2020-02-17

* Update CHANGELOG

* Typo
2020-02-24 16:24:49 +01:00
Jaco Greeff 1f4612bf32 Bump deps (#47) 2020-01-06 13:44:06 +01:00
Jaco Greeff 0e50f267d1 Add GH actions (#37)
* Add GH actions

* Install nightly, test Rust seperately

* Nightly for tests

* Pin nightly version... maybe this works?

* Revert attempted version fix

* Re-try nightly pinning...

* Try without...

* Revert stable experiment

* Run action on PR

* Action only on PR

* Rename push.yml to pr.yml

* Bump deps, update actions

* Bump backtrace (maybe this helps?)

* Don't test rust alongside wasm (split)
2019-10-08 14:00:59 +02:00
Jaco Greeff 0772aa8471 Don't run asm.js through babel (#26) 2019-07-19 17:01:12 +02:00
Jaco Greeff 8c6d2aea12 Only rely on wasm.js (no asm.js duplication) (#25)
* Only rely on wasm.js (no asm.js duplication)

* Add browser entry

* Make asm.js tests pass

* Remove (now-unsued) mock dep
2019-07-19 11:06:31 +02:00
Jaco Greeff 72d4ec56b5 Add asm.js generation with CRYPTO_ASM env var (#23)
* Add asm.js generation, import via index-asm.js

* Less sed-y, more babel-y

* Throw error when some failed

* CRYPTO_ASM env flag

* CHANGELOG
2019-07-18 15:38:50 +02:00
Jaco Greeff 2b637b079a Swap to eslint (#22)
* Swap to eslint

* Remove links to outdated packages

* Bump hex_literal to 0.2.0

* Bump version
2019-07-17 11:23:11 +02:00
Jaco Greeff f39b68f83d Add known signature tests (from subkey, actual values) (#20)
* Add know signing test (from subkey)

* Align sr25519 known sigs

* 0.10 (schnorrkel got a bump)
2019-05-09 15:18:44 +02:00
Jaco Greeff ed3e822d82 Fix error logging (#14) 2019-03-30 10:20:23 +01:00
Jaco Greeff e668b96bca Log init errors to the console (#11)
* Log init errors to the console

* Use stable @polkadot/util packages
2019-03-27 22:12:54 +01:00
Jaco Greeff 4e6bf711ed Pull down binaries for binaryen (instead of building) (#9)
* Pull down binaries for binaryen (instead of building)

* Try x86 version

* Skeip build deps

* Try with a "stable" version?

* Extend crypto

* Use Xenial

* Cache binaryen

* dalek-ed25519 (WIP)

* Small test cleanups

* Revamp binaryen cache

* Update ed25519 tests

* Remove externals for sr & ed

* Test with --release
2019-03-22 10:07:22 +01:00
Jaco Greeff dde6a2f7af Build updates (#5)
* Build script updates

* Add @babel/core (peerdep)
2019-03-20 13:14:46 +01:00
Jaco Greeff 9438234750 Add wasm-crypto package (just start, incomplete) (#3)
* Add wasm-crypto package (just start, incomplete)

* Update

* Merge master

* Headers

* Add sha512

* Add blake2b

* Add twox

* xxhash with multiple rounds

* Cleanup tests (non-async)

* Adjust signatures

* Doc comments

* schnorrkel 0.1.0 crate

* Simplify export names

* Bip39

* Updates, ext_* function exposure

* bip39 tested and working

* Re-add wasm optimisations

* Cleanup build script

* Auto-detect internal packages

* bip39ToMiniSecret
2019-03-20 10:09:40 +01:00