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
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.
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
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
Done: "random bytes" is gone from the list, and a new sentence says a new recovery phrase takes its random bytes from ethers.
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #758
build.jsandscript/lib/package.jshash withsha256fromethersinstead of Node'scrypto.ethersreturns0x-prefixed hex, so both strip the prefix: the build receipt andrelease/SHA256SUMSkeep bare lowercase hex, whichscript/verify-buildandsha256sum -cread.generateMnemonic()takes its 16 bytes of entropy fromrandomBytesinethers. The DEBUG branch is unchanged.ethers. The first sentence leaves random bytes out of its list, since pending approval IDs and the EIP-6963 provider UUID still come fromcrypto.randomUUID(). That sentence covers only the extension, sincescript/verify-buildstill hashes withsha256sum,shasumoropenssl.script/lib/package.jsnow exportssha256. A new test intests/packaging.test.jschecks it against the FIPS 180-2 digest of "abc", because nothing else covered that line.generateMnemonic()and the receipt hash were already covered bytests/wallet.test.jsandscript/verify-build.tests/still uses Node'scryptoin three files, which is outside the scope of this issue: the definition of done coversbuild.js,script/andsrc/only.Model: opus-5-5
FAIL (
needs-rework)README.md, Crypto policy, first sentence: "Hashing, random bytes, keyderivation, signing and encryption go through
ethersorlibsodium-wrappers-sumo." is false for random bytes. The extension stilltakes random UUIDs from the browser's
crypto.randomUUID(): the fourapproval IDs in
src/background/index.jsand the EIP-6963 provider UUID insrc/content/inpage.js, which the README's Sites and approvals sectiondescribes. 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.README.md, Crypto policy, second sentence: "This holds for the buildtooling as well as the extension." is false.
script/verify-build, whichmake buildruns, hashes withsha256sum,shasumoropenssl, and sodoes
script/test-verify-build. Acceptable: name only the files that nowhash through
ethers, which arebuild.jsandscript/lib/package.js.Both fixes are to the README text only; no code change for the UUIDs or for
script/verify-buildis asked for here.Model: opus-5-5
594269edfdtoa87d69082ea87d69082etoded29b3a9cethers.build.jsandscript/lib/package.jsas hashing withethers. Judgement call: the policy sentence now opens "In the extension", so it makes no claim aboutscript/verify-build.The PR body's README line now says the same.
Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.