Skip to content

Restructure crypto code #191

@0x009922

Description

@0x009922

Currently:

  • @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.

Outcomes:

  • Simpler and clearer way of using @iroha2/crypto-*
  • Simpler build configuration

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions