Commit b3566c1
authored
chore: Use SHA-256 utility (#1406)
Use `sha256` utility from `metamask/utils` which has the same
implementation.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Switch hashing to `@metamask/utils` `sha256` in signing and
verification, removing fallback logic/tests and bumping the utils
dependency.
>
> - **Crypto/Verification**:
> - Replace custom/`@noble/hashes` SHA-256 with `sha256` from
`@metamask/utils` in `src/verify.ts` and `scripts/sign-registry.ts`.
> - Remove internal `sha256` helper and noble imports; adjust signing to
hash file bytes before `secp256k1.sign`.
> - **Tests**:
> - Delete fallback digest tests; retain signature validity tests in
`src/verify.test.ts`.
> - **Dependencies**:
> - Bump `@metamask/utils` to `^11.9.0`.
> - Remove `@noble/hashes` from `dependencies` and update lockfile.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
19c4a7d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 5b73802 commit b3566c1
File tree
5 files changed
+21
-76
lines changed- scripts
- src
5 files changed
+21
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 65 | | |
106 | 66 | | |
107 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 28 | | |
51 | 29 | | |
52 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
1306 | | - | |
| 1306 | + | |
1307 | 1307 | | |
1308 | | - | |
1309 | 1308 | | |
1310 | 1309 | | |
1311 | 1310 | | |
| |||
1401 | 1400 | | |
1402 | 1401 | | |
1403 | 1402 | | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1407 | 1406 | | |
1408 | 1407 | | |
1409 | 1408 | | |
1410 | 1409 | | |
1411 | 1410 | | |
1412 | 1411 | | |
| 1412 | + | |
1413 | 1413 | | |
| 1414 | + | |
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
1417 | | - | |
| 1418 | + | |
1418 | 1419 | | |
1419 | 1420 | | |
1420 | 1421 | | |
| |||
1793 | 1794 | | |
1794 | 1795 | | |
1795 | 1796 | | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
1796 | 1804 | | |
1797 | 1805 | | |
1798 | 1806 | | |
| |||
0 commit comments