Build hashes and recovery-phrase entropy come from ethers (closes #758) #767

Open
clawbot wants to merge 1 commits from issue-758-crypto-through-ethers into next
pull from: issue-758-crypto-through-ethers
Collaborator

Closes #758

  • build.js and script/lib/package.js hash with sha256 from ethers instead of Node's crypto. ethers returns 0x-prefixed hex, so both strip the prefix: the build receipt and release/SHA256SUMS keep bare lowercase hex, which script/verify-build and sha256sum -c read.
  • generateMnemonic() takes its 16 bytes of entropy from randomBytes in ethers. The DEBUG branch is unchanged.
  • README Crypto policy: the two sentences that listed these as exceptions now say they use ethers. The first sentence leaves random bytes out of its list, since pending approval IDs and the EIP-6963 provider UUID still come from crypto.randomUUID(). That sentence covers only the extension, since script/verify-build still hashes with sha256sum, shasum or openssl.
  • script/lib/package.js now exports sha256. A new test in tests/packaging.test.js checks it against the FIPS 180-2 digest of "abc", because nothing else covered that line. generateMnemonic() and the receipt hash were already covered by tests/wallet.test.js and script/verify-build.

tests/ still uses Node's crypto in three files, which is outside the scope of this issue: the definition of done covers build.js, script/ and src/ only.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/AutistMask/issues/758 - `build.js` and `script/lib/package.js` hash with `sha256` from `ethers` instead of Node's `crypto`. `ethers` returns `0x`-prefixed hex, so both strip the prefix: the build receipt and `release/SHA256SUMS` keep bare lowercase hex, which `script/verify-build` and `sha256sum -c` read. - `generateMnemonic()` takes its 16 bytes of entropy from `randomBytes` in `ethers`. The DEBUG branch is unchanged. - README Crypto policy: the two sentences that listed these as exceptions now say they use `ethers`. The first sentence leaves random bytes out of its list, since pending approval IDs and the EIP-6963 provider UUID still come from `crypto.randomUUID()`. That sentence covers only the extension, since `script/verify-build` still hashes with `sha256sum`, `shasum` or `openssl`. - `script/lib/package.js` now exports `sha256`. A new test in `tests/packaging.test.js` checks it against the FIPS 180-2 digest of "abc", because nothing else covered that line. `generateMnemonic()` and the receipt hash were already covered by `tests/wallet.test.js` and `script/verify-build`. `tests/` still uses Node's `crypto` in three files, which is outside the scope of this issue: the definition of done covers `build.js`, `script/` and `src/` only. Model: opus-5-5
clawbot added the needs-review label 2026-11-10 21:29:42 +01:00
clawbot self-assigned this 2026-11-10 21:29:42 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. README.md, Crypto policy, first sentence: "Hashing, random bytes, key
    derivation, signing and encryption go through ethers or
    libsodium-wrappers-sumo." is false for random bytes. The extension still
    takes random UUIDs from the browser's crypto.randomUUID(): the four
    approval IDs in src/background/index.js and the EIP-6963 provider UUID in
    src/content/inpage.js, which the README's Sites and approvals section
    describes. Acceptable: drop "random bytes" from that list, and state only
    what this change made true, for example that a new recovery phrase takes its
    random bytes from ethers.

  2. README.md, Crypto policy, second sentence: "This holds for the build
    tooling as well as the extension." is false. script/verify-build, which
    make build runs, hashes with sha256sum, shasum or openssl, and so
    does script/test-verify-build. Acceptable: name only the files that now
    hash through ethers, which are build.js and script/lib/package.js.

Both fixes are to the README text only; no code change for the UUIDs or for
script/verify-build is asked for here.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `README.md`, Crypto policy, first sentence: "Hashing, random bytes, key derivation, signing and encryption go through `ethers` or `libsodium-wrappers-sumo`." is false for random bytes. The extension still takes random UUIDs from the browser's `crypto.randomUUID()`: the four approval IDs in `src/background/index.js` and the EIP-6963 provider UUID in `src/content/inpage.js`, which the README's Sites and approvals section describes. Acceptable: drop "random bytes" from that list, and state only what this change made true, for example that a new recovery phrase takes its random bytes from `ethers`. 2. `README.md`, Crypto policy, second sentence: "This holds for the build tooling as well as the extension." is false. `script/verify-build`, which `make build` runs, hashes with `sha256sum`, `shasum` or `openssl`, and so does `script/test-verify-build`. Acceptable: name only the files that now hash through `ethers`, which are `build.js` and `script/lib/package.js`. Both fixes are to the README text only; no code change for the UUIDs or for `script/verify-build` is asked for here. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-10 22:29:47 +01:00
clawbot force-pushed issue-758-crypto-through-ethers from 594269edfd to a87d69082e 2026-11-10 22:33:14 +01:00 Compare
clawbot added 1 commit 2026-11-10 22:40:53 +01:00
fix: build hashes and recovery-phrase entropy come from ethers (closes #758)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
ded29b3a9c
build.js and script/lib/package.js hash with sha256 from ethers, with the
0x prefix stripped so the build receipt and SHA256SUMS keep bare lowercase
hex. generateMnemonic() takes its 16 bytes of entropy from randomBytes in
ethers. The README Crypto policy no longer lists these as exceptions.

Model: opus-5-5
clawbot force-pushed issue-758-crypto-through-ethers from a87d69082e to ded29b3a9c 2026-11-10 22:40:53 +01:00 Compare
Author
Collaborator
  1. Done: "random bytes" is gone from the list, and a new sentence says a new recovery phrase takes its random bytes from ethers.
  2. Done: the build-tooling sentence is gone, and a new one names build.js and script/lib/package.js as hashing with ethers. Judgement call: the policy sentence now opens "In the extension", so it makes no claim about script/verify-build.

The PR body's README line now says the same.

Model: opus-5-5

1. Done: "random bytes" is gone from the list, and a new sentence says a new recovery phrase takes its random bytes from `ethers`. 2. Done: the build-tooling sentence is gone, and a new one names `build.js` and `script/lib/package.js` as hashing with `ethers`. Judgement call: the policy sentence now opens "In the extension", so it makes no claim about `script/verify-build`. The PR body's README line now says the same. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-10 22:50:16 +01:00
Some checks are pending
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-758-crypto-through-ethers:issue-758-crypto-through-ethers
git checkout issue-758-crypto-through-ethers
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#767