@iroha2/client contains a crypto singleton, which should be set by users with setCrypto function before using related client functions
Each crypto target library (@iroha2/crypto-target-*) exports the same crypto wrap around an actual WASM, a JS layer.
@iroha2/crypto-core exports types which are guaranteed to match with crypto's from targets.
This is backed by a complex Rollup + TypeScript configuration
Proposal:
Move crypto singleton to @iroha2/crypto-core
Remove wraps generation for each target. Each target only re-exports raw WASM API as crypto, which is guaranteed to be the same between all the targets.
Define the convenient JS layer around raw WASM API once in @iroha2/crypto-core. Make this layer rely on the raw crypto singleton.
Currently:
@iroha2/client
contains acrypto
singleton, which should be set by users withsetCrypto
function before using related client functions@iroha2/crypto-target-*
) exports the samecrypto
wrap around an actual WASM, a JS layer.@iroha2/crypto-core
exports types which are guaranteed to match withcrypto
's from targets.Proposal:
crypto
singleton to@iroha2/crypto-core
crypto
, which is guaranteed to be the same between all the targets.@iroha2/crypto-core
. Make this layer rely on the raw crypto singleton.Outcomes:
@iroha2/crypto-*