Skip to content

Conformance

Bip39Chiper-TS is verified against the official format v1 vectors in bip39-chiper-test-vectors, included as a Git submodule at vendor/test-vectors/.

See also CONFORMANCE.md in the vectors repository.

Clone with submodules

git clone --recurse-submodules https://github.com/li-nd/bip39-chiper-ts.git
cd bip39-chiper-ts
npm install

Already cloned?

git submodule update --init --recursive

After init, vendor/test-vectors/v1/manifest.json should exist.

Run tests

npm run test:fast    # ~570 cases (~30s) — skips heavy kdf.json
npm test             # full suite including kdf.json (~9+ min)
npm run test:conformance

Why is kdf slow?

kdf.json includes PBKDF2 cases with up to 20 000 000 iterations (hundreds of millions of HMAC rounds total). That layer validates key derivation against published hex digests; it is intentionally expensive. Everyday development can use test:fast.

Layer File Cases Covered by test:fast
0 manifest.json yes
1 kdf.json 80 no
2 tokens.json 100 yes
3 obfuscate.json 96 yes
4 recovery.json 288 yes
5 normalize.json 70 yes
6 export.json 15 yes

Total: ~649 vector cases.

Layout

vendor/test-vectors/          ← submodule
  CONFORMANCE.md
  v1/
    manifest.json
    kdf.json
    tokens.json
    obfuscate.json
    recovery.json
    normalize.json
    export.json
    export-files/

Vectors are not published in the npm tarball (files in package.json is dist + README + LICENSE only).

CI tip

- uses: actions/checkout@v4
  with:
    submodules: recursive

Spec sync

If the normative algorithm changes, update algorithm-spec.md here in lockstep with the vectors repo and the published spec. Do not “fix” failing vectors — fix the library.

Published library docs: ts.chiper.developer.pm.