ox 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/core/Engine.d.ts +43 -11
  3. package/dist/core/Engine.d.ts.map +1 -1
  4. package/dist/core/Engine.js +40 -10
  5. package/dist/core/Engine.js.map +1 -1
  6. package/dist/core/Hash.d.ts +36 -0
  7. package/dist/core/Hash.d.ts.map +1 -1
  8. package/dist/core/Hash.js +35 -0
  9. package/dist/core/Hash.js.map +1 -1
  10. package/dist/core/internal/engine.d.ts +8 -8
  11. package/dist/core/internal/engine.d.ts.map +1 -1
  12. package/dist/index.d.ts +5 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +5 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/node/Ed25519.d.ts +33 -0
  17. package/dist/node/Ed25519.d.ts.map +1 -0
  18. package/dist/node/Ed25519.js +67 -0
  19. package/dist/node/Ed25519.js.map +1 -0
  20. package/dist/node/Engine.d.ts +29 -16
  21. package/dist/node/Engine.d.ts.map +1 -1
  22. package/dist/node/Engine.js +38 -14
  23. package/dist/node/Engine.js.map +1 -1
  24. package/dist/node/Hash.d.ts +17 -19
  25. package/dist/node/Hash.d.ts.map +1 -1
  26. package/dist/node/Hash.js +17 -19
  27. package/dist/node/Hash.js.map +1 -1
  28. package/dist/node/Keystore.d.ts +36 -0
  29. package/dist/node/Keystore.d.ts.map +1 -0
  30. package/dist/node/Keystore.js +72 -0
  31. package/dist/node/Keystore.js.map +1 -0
  32. package/dist/node/Mnemonic.d.ts +35 -0
  33. package/dist/node/Mnemonic.d.ts.map +1 -0
  34. package/dist/node/Mnemonic.js +46 -0
  35. package/dist/node/Mnemonic.js.map +1 -0
  36. package/dist/node/P256.d.ts +32 -0
  37. package/dist/node/P256.d.ts.map +1 -0
  38. package/dist/node/P256.js +34 -0
  39. package/dist/node/P256.js.map +1 -0
  40. package/dist/node/X25519.d.ts +31 -0
  41. package/dist/node/X25519.d.ts.map +1 -0
  42. package/dist/node/X25519.js +71 -0
  43. package/dist/node/X25519.js.map +1 -0
  44. package/dist/node/index.d.ts +95 -8
  45. package/dist/node/index.d.ts.map +1 -1
  46. package/dist/node/index.js +95 -8
  47. package/dist/node/index.js.map +1 -1
  48. package/dist/trusted-setups/Paths.d.ts +1 -0
  49. package/dist/trusted-setups/Paths.d.ts.map +1 -1
  50. package/dist/trusted-setups/Paths.js +1 -0
  51. package/dist/trusted-setups/Paths.js.map +1 -1
  52. package/dist/trusted-setups/Setups.d.ts +35 -0
  53. package/dist/trusted-setups/Setups.d.ts.map +1 -0
  54. package/dist/trusted-setups/Setups.js +29 -0
  55. package/dist/trusted-setups/Setups.js.map +1 -0
  56. package/dist/trusted-setups/index.d.ts +20 -0
  57. package/dist/trusted-setups/index.d.ts.map +1 -1
  58. package/dist/trusted-setups/index.js +20 -0
  59. package/dist/trusted-setups/index.js.map +1 -1
  60. package/dist/trusted-setups/internal/paths.d.ts.map +1 -1
  61. package/dist/trusted-setups/internal/paths.js +1 -1
  62. package/dist/trusted-setups/internal/paths.js.map +1 -1
  63. package/dist/trusted-setups/internal/setups/mainnet.d.ts +7 -0
  64. package/dist/trusted-setups/internal/setups/mainnet.d.ts.map +1 -0
  65. package/dist/trusted-setups/internal/setups/mainnet.js +11 -0
  66. package/dist/trusted-setups/internal/setups/mainnet.js.map +1 -0
  67. package/dist/wasm/Ed25519.d.ts +35 -0
  68. package/dist/wasm/Ed25519.d.ts.map +1 -0
  69. package/dist/wasm/Ed25519.js +88 -0
  70. package/dist/wasm/Ed25519.js.map +1 -0
  71. package/dist/wasm/Engine.d.ts +36 -26
  72. package/dist/wasm/Engine.d.ts.map +1 -1
  73. package/dist/wasm/Engine.js +44 -25
  74. package/dist/wasm/Engine.js.map +1 -1
  75. package/dist/wasm/Hash.d.ts +13 -19
  76. package/dist/wasm/Hash.d.ts.map +1 -1
  77. package/dist/wasm/Hash.js +21 -27
  78. package/dist/wasm/Hash.js.map +1 -1
  79. package/dist/wasm/Keystore.d.ts +51 -0
  80. package/dist/wasm/Keystore.d.ts.map +1 -0
  81. package/dist/wasm/Keystore.js +51 -0
  82. package/dist/wasm/Keystore.js.map +1 -0
  83. package/dist/wasm/Kzg.d.ts +112 -0
  84. package/dist/wasm/Kzg.d.ts.map +1 -0
  85. package/dist/wasm/Kzg.js +333 -0
  86. package/dist/wasm/Kzg.js.map +1 -0
  87. package/dist/wasm/Mnemonic.d.ts +33 -0
  88. package/dist/wasm/Mnemonic.d.ts.map +1 -0
  89. package/dist/wasm/Mnemonic.js +30 -0
  90. package/dist/wasm/Mnemonic.js.map +1 -0
  91. package/dist/wasm/Secp256k1.d.ts +55 -0
  92. package/dist/wasm/Secp256k1.d.ts.map +1 -0
  93. package/dist/wasm/Secp256k1.js +181 -0
  94. package/dist/wasm/Secp256k1.js.map +1 -0
  95. package/dist/wasm/X25519.d.ts +33 -0
  96. package/dist/wasm/X25519.d.ts.map +1 -0
  97. package/dist/wasm/X25519.js +53 -0
  98. package/dist/wasm/X25519.js.map +1 -0
  99. package/dist/wasm/index.d.ts +124 -12
  100. package/dist/wasm/index.d.ts.map +1 -1
  101. package/dist/wasm/index.js +124 -12
  102. package/dist/wasm/index.js.map +1 -1
  103. package/dist/wasm/internal/blake3.d.ts +11 -0
  104. package/dist/wasm/internal/blake3.d.ts.map +1 -0
  105. package/dist/wasm/internal/blake3.js +31 -0
  106. package/dist/wasm/internal/blake3.js.map +1 -0
  107. package/dist/wasm/internal/blake3.wasm.d.ts +3 -0
  108. package/dist/wasm/internal/blake3.wasm.d.ts.map +1 -0
  109. package/dist/wasm/internal/blake3.wasm.js +10 -0
  110. package/dist/wasm/internal/blake3.wasm.js.map +1 -0
  111. package/dist/wasm/internal/crypto25519.d.ts +16 -0
  112. package/dist/wasm/internal/crypto25519.d.ts.map +1 -0
  113. package/dist/wasm/internal/crypto25519.js +5 -0
  114. package/dist/wasm/internal/crypto25519.js.map +1 -0
  115. package/dist/wasm/internal/crypto25519.wasm.d.ts +3 -0
  116. package/dist/wasm/internal/crypto25519.wasm.d.ts.map +1 -0
  117. package/dist/wasm/internal/crypto25519.wasm.js +10 -0
  118. package/dist/wasm/internal/crypto25519.wasm.js.map +1 -0
  119. package/dist/wasm/internal/ed25519.d.ts +4 -0
  120. package/dist/wasm/internal/ed25519.d.ts.map +1 -0
  121. package/dist/wasm/internal/ed25519.js +21 -0
  122. package/dist/wasm/internal/ed25519.js.map +1 -0
  123. package/dist/wasm/internal/hashes.d.ts +12 -0
  124. package/dist/wasm/internal/hashes.d.ts.map +1 -0
  125. package/dist/wasm/internal/hashes.js +8 -0
  126. package/dist/wasm/internal/hashes.js.map +1 -0
  127. package/dist/wasm/internal/hashes.wasm.d.ts +4 -2
  128. package/dist/wasm/internal/hashes.wasm.d.ts.map +1 -1
  129. package/dist/wasm/internal/hashes.wasm.js +4 -2
  130. package/dist/wasm/internal/hashes.wasm.js.map +1 -1
  131. package/dist/wasm/internal/instantiate.d.ts +12 -0
  132. package/dist/wasm/internal/instantiate.d.ts.map +1 -1
  133. package/dist/wasm/internal/instantiate.js +23 -7
  134. package/dist/wasm/internal/instantiate.js.map +1 -1
  135. package/dist/wasm/internal/keystore.d.ts +10 -0
  136. package/dist/wasm/internal/keystore.d.ts.map +1 -0
  137. package/dist/wasm/internal/keystore.js +10 -0
  138. package/dist/wasm/internal/keystore.js.map +1 -0
  139. package/dist/wasm/internal/kzg.d.ts +17 -0
  140. package/dist/wasm/internal/kzg.d.ts.map +1 -0
  141. package/dist/wasm/internal/kzg.js +8 -0
  142. package/dist/wasm/internal/kzg.js.map +1 -0
  143. package/dist/wasm/internal/kzg.wasm.d.ts +3 -0
  144. package/dist/wasm/internal/kzg.wasm.d.ts.map +1 -0
  145. package/dist/wasm/internal/kzg.wasm.js +10 -0
  146. package/dist/wasm/internal/kzg.wasm.js.map +1 -0
  147. package/dist/wasm/internal/mnemonic.d.ts +4 -0
  148. package/dist/wasm/internal/mnemonic.d.ts.map +1 -0
  149. package/dist/wasm/internal/mnemonic.js +45 -0
  150. package/dist/wasm/internal/mnemonic.js.map +1 -0
  151. package/dist/wasm/internal/pbkdf2.d.ts +12 -0
  152. package/dist/wasm/internal/pbkdf2.d.ts.map +1 -0
  153. package/dist/wasm/internal/pbkdf2.js +51 -0
  154. package/dist/wasm/internal/pbkdf2.js.map +1 -0
  155. package/dist/wasm/internal/scrypt.d.ts +16 -0
  156. package/dist/wasm/internal/scrypt.d.ts.map +1 -0
  157. package/dist/wasm/internal/scrypt.js +78 -0
  158. package/dist/wasm/internal/scrypt.js.map +1 -0
  159. package/dist/wasm/internal/scrypt.wasm.d.ts +7 -0
  160. package/dist/wasm/internal/scrypt.wasm.d.ts.map +1 -0
  161. package/dist/wasm/internal/scrypt.wasm.js +14 -0
  162. package/dist/wasm/internal/scrypt.wasm.js.map +1 -0
  163. package/dist/wasm/internal/secp256k1.d.ts +16 -0
  164. package/dist/wasm/internal/secp256k1.d.ts.map +1 -0
  165. package/dist/wasm/internal/secp256k1.js +20 -0
  166. package/dist/wasm/internal/secp256k1.js.map +1 -0
  167. package/dist/wasm/internal/secp256k1.wasm.d.ts +3 -0
  168. package/dist/wasm/internal/secp256k1.wasm.d.ts.map +1 -0
  169. package/dist/wasm/internal/secp256k1.wasm.js +10 -0
  170. package/dist/wasm/internal/secp256k1.wasm.js.map +1 -0
  171. package/dist/wasm/internal/x25519.d.ts +4 -0
  172. package/dist/wasm/internal/x25519.d.ts.map +1 -0
  173. package/dist/wasm/internal/x25519.js +21 -0
  174. package/dist/wasm/internal/x25519.js.map +1 -0
  175. package/package.json +64 -2
  176. package/src/core/Engine.ts +84 -11
  177. package/src/core/Hash.ts +59 -0
  178. package/src/core/_test/Block.test.ts +9 -2
  179. package/src/core/_test/Engine.test-d.ts +56 -0
  180. package/src/core/_test/Engine.test.ts +95 -0
  181. package/src/core/_test/Hash.test-d.ts +18 -0
  182. package/src/core/_test/Hash.test.ts +100 -1
  183. package/src/core/_test/Hash.vectors.test.ts +7 -0
  184. package/src/core/_test/Transaction.test.ts +11 -2
  185. package/src/core/internal/engine.ts +8 -8
  186. package/src/index.ts +5 -2
  187. package/src/node/Ed25519.ts +87 -0
  188. package/src/node/Engine.ts +79 -23
  189. package/src/node/Hash.ts +25 -30
  190. package/src/node/Keystore.ts +103 -0
  191. package/src/node/Mnemonic.ts +68 -0
  192. package/src/node/P256.ts +48 -0
  193. package/src/node/X25519.ts +93 -0
  194. package/src/node/_test/Curves.fuzz.ts +76 -0
  195. package/src/node/_test/Ed25519.test-d.ts +35 -0
  196. package/src/node/_test/Ed25519.test.ts +220 -0
  197. package/src/node/_test/Engine.test-d.ts +28 -0
  198. package/src/node/_test/Engine.test.ts +62 -22
  199. package/src/node/_test/Hash.test-d.ts +16 -9
  200. package/src/node/_test/Hash.test.ts +10 -11
  201. package/src/node/_test/Keystore.fuzz.ts +58 -0
  202. package/src/node/_test/Keystore.test-d.ts +43 -0
  203. package/src/node/_test/Keystore.test.ts +198 -0
  204. package/src/node/_test/Mnemonic.fuzz.ts +31 -0
  205. package/src/node/_test/Mnemonic.test-d.ts +21 -0
  206. package/src/node/_test/Mnemonic.test.ts +98 -0
  207. package/src/node/_test/P256.test-d.ts +29 -0
  208. package/src/node/_test/P256.test.ts +102 -0
  209. package/src/node/_test/X25519.test-d.ts +28 -0
  210. package/src/node/_test/X25519.test.ts +239 -0
  211. package/src/node/index.ts +100 -8
  212. package/src/trusted-setups/Paths.ts +1 -0
  213. package/src/trusted-setups/README.md +39 -0
  214. package/src/trusted-setups/Setups.ts +46 -0
  215. package/src/trusted-setups/_test/Paths.test.ts +16 -0
  216. package/src/trusted-setups/_test/Setups.test-d.ts +7 -0
  217. package/src/trusted-setups/_test/Setups.test.ts +43 -0
  218. package/src/trusted-setups/_test/index.test.ts +1 -0
  219. package/src/trusted-setups/index.ts +21 -0
  220. package/src/trusted-setups/internal/paths.ts +4 -1
  221. package/src/trusted-setups/internal/setups/mainnet.source.json +7 -0
  222. package/src/trusted-setups/internal/setups/mainnet.ts +16 -0
  223. package/src/version.ts +1 -1
  224. package/src/wasm/Ed25519.ts +114 -0
  225. package/src/wasm/Engine.ts +78 -31
  226. package/src/wasm/Hash.bench.ts +2 -2
  227. package/src/wasm/Hash.ts +29 -50
  228. package/src/wasm/Keystore.bench.ts +26 -0
  229. package/src/wasm/Keystore.ts +66 -0
  230. package/src/wasm/Kzg.bench.ts +63 -0
  231. package/src/wasm/Kzg.ts +518 -0
  232. package/src/wasm/Mnemonic.ts +44 -0
  233. package/src/wasm/Secp256k1.bench.ts +79 -0
  234. package/src/wasm/Secp256k1.ts +248 -0
  235. package/src/wasm/X25519.ts +70 -0
  236. package/src/wasm/_test/Crypto25519.conformance.ts +57 -0
  237. package/src/wasm/_test/Crypto25519.fuzz.ts +187 -0
  238. package/src/wasm/_test/Ed25519.test-d.ts +28 -0
  239. package/src/wasm/_test/Ed25519.test.ts +168 -0
  240. package/src/wasm/_test/Ed25519.vectors.test.ts +73 -0
  241. package/src/wasm/_test/Engine.test-d.ts +29 -0
  242. package/src/wasm/_test/Engine.test.ts +59 -25
  243. package/src/wasm/_test/Hash.browser.test.ts +14 -7
  244. package/src/wasm/_test/Hash.fuzz.ts +58 -23
  245. package/src/wasm/_test/Hash.test-d.ts +16 -10
  246. package/src/wasm/_test/Hash.test.ts +148 -48
  247. package/src/wasm/_test/Hash.vectors.test.ts +15 -8
  248. package/src/wasm/_test/Keystore.browser.test.ts +73 -0
  249. package/src/wasm/_test/Keystore.fuzz.ts +163 -0
  250. package/src/wasm/_test/Keystore.test-d.ts +42 -0
  251. package/src/wasm/_test/Keystore.test.ts +477 -0
  252. package/src/wasm/_test/Keystore.vectors.test.ts +21 -0
  253. package/src/wasm/_test/Kzg.test-d.ts +19 -0
  254. package/src/wasm/_test/Kzg.test.ts +220 -0
  255. package/src/wasm/_test/Mnemonic.test-d.ts +17 -0
  256. package/src/wasm/_test/Mnemonic.test.ts +110 -0
  257. package/src/wasm/_test/Runtime.test.ts +9 -0
  258. package/src/wasm/_test/Secp256k1.test-d.ts +35 -0
  259. package/src/wasm/_test/Secp256k1.test.ts +354 -0
  260. package/src/wasm/_test/X25519.test-d.ts +21 -0
  261. package/src/wasm/_test/X25519.test.ts +194 -0
  262. package/src/wasm/_test/fixtures.ts +4 -0
  263. package/src/wasm/index.ts +130 -12
  264. package/src/wasm/internal/blake3.ts +45 -0
  265. package/src/wasm/internal/blake3.wasm.ts +11 -0
  266. package/src/wasm/internal/crypto25519.ts +43 -0
  267. package/src/wasm/internal/crypto25519.wasm.ts +11 -0
  268. package/src/wasm/internal/ed25519.ts +31 -0
  269. package/src/wasm/internal/hashes.ts +29 -0
  270. package/src/wasm/internal/hashes.wasm.ts +5 -2
  271. package/src/wasm/internal/instantiate.ts +29 -9
  272. package/src/wasm/internal/keystore.ts +19 -0
  273. package/src/wasm/internal/kzg.ts +50 -0
  274. package/src/wasm/internal/kzg.wasm.ts +11 -0
  275. package/src/wasm/internal/mnemonic.ts +56 -0
  276. package/src/wasm/internal/pbkdf2.ts +86 -0
  277. package/src/wasm/internal/scrypt.ts +131 -0
  278. package/src/wasm/internal/scrypt.wasm.ts +17 -0
  279. package/src/wasm/internal/secp256k1.ts +62 -0
  280. package/src/wasm/internal/secp256k1.wasm.ts +11 -0
  281. package/src/wasm/internal/x25519.ts +29 -0
  282. package/wasm/vendor/c-kzg-4844/LICENSE +201 -0
  283. package/wasm/vendor/c-kzg-4844/blst/LICENSE +201 -0
  284. package/src/trusted-setups/internal/setups/mainnet.txt +0 -4163
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mainnet.js","sourceRoot":"","sources":["../../../../src/trusted-setups/internal/setups/mainnet.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,+DAA+D;AAC/D,+EAA+E;AAE/E,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GACrB,kggQAAkggQ,CAAA;AAEpggQ,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GACrB,kggQAAkggQ,CAAA;AAEpggQ,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GACrB,koQAAkoQ,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type * as Engine from '../core/Engine.js';
2
+ import type * as Errors from '../core/Errors.js';
3
+ import * as internal from './internal/instantiate.js';
4
+ export * from '../core/Ed25519.js';
5
+ export { MemoryError } from './internal/instantiate.js';
6
+ /**
7
+ * Compiles WASM implementations of selected [`Ed25519`](/api/Ed25519)
8
+ * primitives, without installing them.
9
+ *
10
+ * Public-key conversion and random key generation remain on Ox's default
11
+ * implementation. The public conversion is omitted because Monocypher does not
12
+ * reproduce Ox's invalid-point validation.
13
+ *
14
+ * @example
15
+ * ```ts twoslash
16
+ * // @noErrors
17
+ * import { Engine } from 'ox'
18
+ * import { Ed25519 } from 'ox/wasm'
19
+ *
20
+ * await Engine.install({ Ed25519: Ed25519.engine() })
21
+ *
22
+ * Ed25519.getPublicKey({ privateKey: '0x...' })
23
+ * ```
24
+ *
25
+ * @returns The WASM implementation of part of the `Ed25519` slot.
26
+ */
27
+ export declare function engine(): Promise<engine.ReturnType>;
28
+ export declare namespace engine {
29
+ /** Every `Ed25519` primitive this module implements. */
30
+ type ReturnType = {
31
+ [key in 'getPublicKey' | 'sign' | 'toMontgomerySecret' | 'verify']-?: NonNullable<Engine.Eddsa[key]>;
32
+ };
33
+ type ErrorType = internal.MemoryError | Errors.GlobalErrorType;
34
+ }
35
+ //# sourceMappingURL=Ed25519.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ed25519.d.ts","sourceRoot":"","sources":["../../src/wasm/Ed25519.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAGhD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AAErD,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAKvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CA4DzD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,wDAAwD;IACxD,KAAK,UAAU,GAAG;SACf,GAAG,IACA,cAAc,GACd,MAAM,GACN,oBAAoB,GACpB,QAAQ,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAChD,CAAA;IAED,KAAK,SAAS,GAAG,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,eAAe,CAAA;CAC/D"}
@@ -0,0 +1,88 @@
1
+ import * as crypto25519 from './internal/crypto25519.js';
2
+ import * as ed25519 from './internal/ed25519.js';
3
+ export * from '../core/Ed25519.js';
4
+ export { MemoryError } from './internal/instantiate.js';
5
+ const keySize = 32;
6
+ const signatureSize = 64;
7
+ /**
8
+ * Compiles WASM implementations of selected [`Ed25519`](/api/Ed25519)
9
+ * primitives, without installing them.
10
+ *
11
+ * Public-key conversion and random key generation remain on Ox's default
12
+ * implementation. The public conversion is omitted because Monocypher does not
13
+ * reproduce Ox's invalid-point validation.
14
+ *
15
+ * @example
16
+ * ```ts twoslash
17
+ * // @noErrors
18
+ * import { Engine } from 'ox'
19
+ * import { Ed25519 } from 'ox/wasm'
20
+ *
21
+ * await Engine.install({ Ed25519: Ed25519.engine() })
22
+ *
23
+ * Ed25519.getPublicKey({ privateKey: '0x...' })
24
+ * ```
25
+ *
26
+ * @returns The WASM implementation of part of the `Ed25519` slot.
27
+ */
28
+ export async function engine() {
29
+ const module = await crypto25519.load();
30
+ return {
31
+ getPublicKey(privateKey) {
32
+ assertLength(privateKey, keySize, 'private key');
33
+ module.reserve(keySize * 2);
34
+ const privateKeyPtr = module.heapBase;
35
+ const publicKeyPtr = privateKeyPtr + keySize;
36
+ try {
37
+ module.view().set(privateKey, privateKeyPtr);
38
+ module.exports.ed25519_get_public_key(privateKeyPtr, publicKeyPtr);
39
+ return module.view().slice(publicKeyPtr, publicKeyPtr + keySize);
40
+ }
41
+ finally {
42
+ module.exports.zero(privateKeyPtr, keySize * 2);
43
+ }
44
+ },
45
+ sign(payload, privateKey) {
46
+ assertLength(privateKey, keySize, 'private key');
47
+ return ed25519.sign(module, payload, privateKey);
48
+ },
49
+ toMontgomerySecret(privateKey) {
50
+ assertLength(privateKey, keySize, 'private key');
51
+ module.reserve(keySize * 2);
52
+ const privateKeyPtr = module.heapBase;
53
+ const secretKeyPtr = privateKeyPtr + keySize;
54
+ try {
55
+ module.view().set(privateKey, privateKeyPtr);
56
+ module.exports.ed25519_to_montgomery_secret(privateKeyPtr, secretKeyPtr);
57
+ return module.view().slice(secretKeyPtr, secretKeyPtr + keySize);
58
+ }
59
+ finally {
60
+ module.exports.zero(privateKeyPtr, keySize * 2);
61
+ }
62
+ },
63
+ verify(signature, payload, publicKey) {
64
+ assertLength(signature, signatureSize, 'signature');
65
+ assertLength(publicKey, keySize, 'public key');
66
+ const size = signatureSize + payload.length + keySize;
67
+ module.reserve(size);
68
+ const signaturePtr = module.heapBase;
69
+ const payloadPtr = signaturePtr + signatureSize;
70
+ const publicKeyPtr = payloadPtr + payload.length;
71
+ try {
72
+ const memory = module.view();
73
+ memory.set(signature, signaturePtr);
74
+ memory.set(payload, payloadPtr);
75
+ memory.set(publicKey, publicKeyPtr);
76
+ return (module.exports.ed25519_verify(signaturePtr, payloadPtr, payload.length, publicKeyPtr) === 1);
77
+ }
78
+ finally {
79
+ module.exports.zero(signaturePtr, size);
80
+ }
81
+ },
82
+ };
83
+ }
84
+ function assertLength(value, length, name) {
85
+ if (value.length !== length)
86
+ throw new RangeError(`Ed25519 ${name} must be ${length} bytes, got ${value.length}`);
87
+ }
88
+ //# sourceMappingURL=Ed25519.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ed25519.js","sourceRoot":"","sources":["../../src/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AY,CAAC,CAAA;gBACnC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;gBAC/B,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;gBACnC,OAAO,CACL,MAAM,CAAC,OAAO,CAAC,cAAc,CAC3B,YAAY,EACZ,UAAU,EACV,OAAO,CAAC,MAAM,EACd,YAAY,CACb,KAAK,CAAC,CACR,CAAA;YACH,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAeD,SAAS,YAAY,CAAC,KAAiB,EAAE,MAAc,EAAE,IAAY;IACnE,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;QACzB,MAAM,IAAI,UAAU,CAClB,WAAW,IAAI,YAAY,MAAM,eAAe,KAAK,CAAC,MAAM,EAAE,CAC/D,CAAA;AACL,CAAC"}
@@ -1,44 +1,46 @@
1
1
  import * as CoreEngine from '../core/Engine.js';
2
2
  import type * as Errors from '../core/Errors.js';
3
+ import * as Ed25519 from './Ed25519.js';
3
4
  import * as Hash from './Hash.js';
5
+ import * as Mnemonic from './Mnemonic.js';
6
+ import * as X25519 from './X25519.js';
4
7
  import type * as internal from './internal/instantiate.js';
8
+ export { AsyncScopeError, get, InvalidSlotValueError, reset, set, UnknownPrimitiveError, UnknownSlotError, with, } from '../core/Engine.js';
9
+ export type { Bls, Ecdh, Ecdsa, Eddsa, Engine, Hash, Keystore, Mnemonic, } from '../core/Engine.js';
5
10
  /**
6
- * Compiles every implementation this entrypoint provides and installs it.
11
+ * Compiles and installs every WASM implementation this entrypoint provides.
7
12
  *
8
- * WASM must be compiled asynchronously, so this is where the `await` lives.
9
- * Everything afterwards, including the hashing itself, is synchronous.
13
+ * Slot compilation starts concurrently. Nothing is installed until every slot
14
+ * resolves successfully.
10
15
  *
11
- * Call it once, during startup, before any crypto call. ox resolves the engine
12
- * at call time, so values computed beforehand used whatever was installed then.
16
+ * Call this once, during startup, before any crypto call. Ox resolves the
17
+ * engine at call time, so values computed beforehand used whatever was
18
+ * installed then.
13
19
  *
14
20
  * @example
15
21
  * ```ts twoslash
16
22
  * // @noErrors
17
- * import { Hash } from 'ox'
18
- * import { Engine } from 'ox/wasm'
23
+ * import { Engine, Hash } from 'ox/wasm'
19
24
  *
20
- * await Engine.load()
25
+ * await Engine.install()
21
26
  *
22
- * Hash.keccak256('0xdeadbeef')
27
+ * Hash.sha256('0xdeadbeef')
23
28
  * ```
24
29
  *
25
30
  * @returns The engine that was installed.
26
31
  */
27
- export declare function load(): Promise<load.ReturnType>;
28
- export declare namespace load {
29
- type ReturnType = create.ReturnType;
30
- type ErrorType = create.ErrorType | CoreEngine.set.ErrorType | Errors.GlobalErrorType;
32
+ export declare function install(): Promise<install.ReturnType>;
33
+ export declare namespace install {
34
+ type ReturnType = engine.ReturnType;
35
+ type ErrorType = engine.ErrorType | CoreEngine.install.ErrorType | Errors.GlobalErrorType;
31
36
  }
32
37
  /**
33
- * Compiles every implementation this entrypoint provides, without installing
34
- * it.
38
+ * Compiles every WASM implementation this entrypoint provides, without
39
+ * installing it.
35
40
  *
36
- * Reach for this where an engine has to exist as a value: measuring one
37
- * implementation against another, or installing through
38
- * [`Engine.with`](/api/Engine/with) for the duration of a call. Combining
39
- * engines does not need it, because
40
- * [`Engine.set`](/api/Engine/set) merges -- `await load()` followed by
41
- * `Engine.set({ Secp256k1 })` leaves both in place.
41
+ * Reach for this where an engine has to exist as a value, such as a benchmark
42
+ * or an [`Engine.with`](/api/Engine/with) scope. Use the individual module's
43
+ * `engine` function to select only some slots.
42
44
  *
43
45
  * @example
44
46
  * ```ts twoslash
@@ -46,17 +48,25 @@ export declare namespace load {
46
48
  * import { Engine, Hash } from 'ox'
47
49
  * import { Engine as Wasm } from 'ox/wasm'
48
50
  *
49
- * const wasm = await Wasm.create()
51
+ * const wasm = await Wasm.engine()
50
52
  *
51
- * Engine.with(wasm, () => Hash.keccak256('0xdeadbeef'))
53
+ * Engine.with(wasm, () => Hash.sha256('0xdeadbeef'))
52
54
  * ```
53
55
  *
54
56
  * @returns An engine, ready to install.
55
57
  */
56
- export declare function create(): Promise<create.ReturnType>;
57
- export declare namespace create {
58
+ export declare function engine(): Promise<engine.ReturnType>;
59
+ export declare namespace engine {
58
60
  /** Every slot this entrypoint supplies, each with its primitives present. */
59
- type ReturnType = Hash.create.ReturnType;
61
+ type ReturnType = {
62
+ Ed25519: Ed25519.engine.ReturnType;
63
+ Hash: Hash.engine.ReturnType;
64
+ Keystore: {
65
+ pbkdf2Sha256: NonNullable<CoreEngine.Keystore['pbkdf2Sha256']>;
66
+ };
67
+ Mnemonic: Mnemonic.engine.ReturnType;
68
+ X25519: X25519.engine.ReturnType;
69
+ };
60
70
  type ErrorType = internal.MemoryError | Errors.GlobalErrorType;
61
71
  }
62
72
  //# sourceMappingURL=Engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../src/wasm/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAIrD;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,KAAK,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;IAEnC,KAAK,SAAS,GACV,MAAM,CAAC,SAAS,GAChB,UAAU,CAAC,GAAG,CAAC,SAAS,GACxB,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuB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e,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAezD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,KAAK,UAAU,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAA;QAClC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAA;QAC5B,QAAQ,EAAE;YACR,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAA;SAC/D,CAAA;QACD,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAA;QACpC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAA;KACjC,CAAA;IAED,KAAK,SAAS,GAAG,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,eAAe,CAAA;CAC/D"}
@@ -1,42 +1,48 @@
1
1
  import * as CoreEngine from '../core/Engine.js';
2
+ import * as Ed25519 from './Ed25519.js';
2
3
  import * as Hash from './Hash.js';
4
+ import * as keystore from './internal/keystore.js';
5
+ import * as Mnemonic from './Mnemonic.js';
6
+ import * as X25519 from './X25519.js';
7
+ export { AsyncScopeError, get, InvalidSlotValueError, reset, set, UnknownPrimitiveError, UnknownSlotError, with, } from '../core/Engine.js';
3
8
  /**
4
- * Compiles every implementation this entrypoint provides and installs it.
9
+ * Compiles and installs every WASM implementation this entrypoint provides.
5
10
  *
6
- * WASM must be compiled asynchronously, so this is where the `await` lives.
7
- * Everything afterwards, including the hashing itself, is synchronous.
11
+ * Slot compilation starts concurrently. Nothing is installed until every slot
12
+ * resolves successfully.
8
13
  *
9
- * Call it once, during startup, before any crypto call. ox resolves the engine
10
- * at call time, so values computed beforehand used whatever was installed then.
14
+ * Call this once, during startup, before any crypto call. Ox resolves the
15
+ * engine at call time, so values computed beforehand used whatever was
16
+ * installed then.
11
17
  *
12
18
  * @example
13
19
  * ```ts twoslash
14
20
  * // @noErrors
15
- * import { Hash } from 'ox'
16
- * import { Engine } from 'ox/wasm'
21
+ * import { Engine, Hash } from 'ox/wasm'
17
22
  *
18
- * await Engine.load()
23
+ * await Engine.install()
19
24
  *
20
- * Hash.keccak256('0xdeadbeef')
25
+ * Hash.sha256('0xdeadbeef')
21
26
  * ```
22
27
  *
23
28
  * @returns The engine that was installed.
24
29
  */
25
- export async function load() {
26
- const engine = await create();
27
- CoreEngine.set(engine);
28
- return engine;
30
+ export async function install() {
31
+ return CoreEngine.install({
32
+ Ed25519: Ed25519.engine(),
33
+ Hash: Hash.engine(),
34
+ Keystore: keystore.engine(),
35
+ Mnemonic: Mnemonic.engine(),
36
+ X25519: X25519.engine(),
37
+ });
29
38
  }
30
39
  /**
31
- * Compiles every implementation this entrypoint provides, without installing
32
- * it.
40
+ * Compiles every WASM implementation this entrypoint provides, without
41
+ * installing it.
33
42
  *
34
- * Reach for this where an engine has to exist as a value: measuring one
35
- * implementation against another, or installing through
36
- * [`Engine.with`](/api/Engine/with) for the duration of a call. Combining
37
- * engines does not need it, because
38
- * [`Engine.set`](/api/Engine/set) merges -- `await load()` followed by
39
- * `Engine.set({ Secp256k1 })` leaves both in place.
43
+ * Reach for this where an engine has to exist as a value, such as a benchmark
44
+ * or an [`Engine.with`](/api/Engine/with) scope. Use the individual module's
45
+ * `engine` function to select only some slots.
40
46
  *
41
47
  * @example
42
48
  * ```ts twoslash
@@ -44,14 +50,27 @@ export async function load() {
44
50
  * import { Engine, Hash } from 'ox'
45
51
  * import { Engine as Wasm } from 'ox/wasm'
46
52
  *
47
- * const wasm = await Wasm.create()
53
+ * const wasm = await Wasm.engine()
48
54
  *
49
- * Engine.with(wasm, () => Hash.keccak256('0xdeadbeef'))
55
+ * Engine.with(wasm, () => Hash.sha256('0xdeadbeef'))
50
56
  * ```
51
57
  *
52
58
  * @returns An engine, ready to install.
53
59
  */
54
- export async function create() {
55
- return { ...(await Hash.create()) };
60
+ export async function engine() {
61
+ const [ed25519, hash, keystoreEngine, mnemonic, x25519] = await Promise.all([
62
+ Ed25519.engine(),
63
+ Hash.engine(),
64
+ keystore.engine(),
65
+ Mnemonic.engine(),
66
+ X25519.engine(),
67
+ ]);
68
+ return {
69
+ Ed25519: ed25519,
70
+ Hash: hash,
71
+ Keystore: keystoreEngine,
72
+ Mnemonic: mnemonic,
73
+ X25519: x25519,
74
+ };
56
75
  }
57
76
  //# sourceMappingURL=Engine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../src/wasm/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,CAAA;IAC7B,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,OAAO,MAAM,CAAA;AACf,CAAC;AAWD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAA;AACrC,CAAC"}
1
+ {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../src/wasm/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAGrC,OAAO,EACL,eAAe,EACf,GAAG,EACH,qBAAqB,EACrB,KAAK,EACL,GAAG,EACH,qBAAqB,EACrB,gBAAgB,EAChB,IAAI,GACL,MAAM,mBAAmB,CAAA;AAY1B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO;IAC3B,OAAO,UAAU,CAAC,OAAO,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE;QACzB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;KACxB,CAAC,CAAA;AACJ,CAAC;AAWD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1E,OAAO,CAAC,MAAM,EAAE;QAChB,IAAI,CAAC,MAAM,EAAE;QACb,QAAQ,CAAC,MAAM,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,MAAM,EAAE;KAChB,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,cAAc;QACxB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACf,CAAA;AACH,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import type * as Engine from '../core/Engine.js';
2
2
  import type * as Errors from '../core/Errors.js';
3
3
  import * as internal from './internal/instantiate.js';
4
+ export * from '../core/Hash.js';
4
5
  export { MemoryError } from './internal/instantiate.js';
5
6
  /**
6
- * Compiles the WASM implementation of the [`Hash`](/api/Hash) primitives, without
7
- * installing it.
7
+ * Compiles the WASM implementation of the [`Hash`](/api/Hash) primitives,
8
+ * without installing it.
8
9
  *
9
- * Most callers want {@link ox#Engine.load} instead, which compiles every
10
+ * Most callers want
11
+ * [`Engine.install`](/wasm/crypto/Engine/install) instead, which compiles every
10
12
  * implementation this entrypoint provides and installs them in one call. Reach
11
13
  * for this to take the `Hash` slot on its own, or to hold the implementation
12
14
  * without touching the installed engine.
@@ -20,29 +22,21 @@ export { MemoryError } from './internal/instantiate.js';
20
22
  * @example
21
23
  * ```ts twoslash
22
24
  * // @noErrors
23
- * import { Engine, Hash } from 'ox'
24
- * import * as WasmHash from 'ox/wasm/Hash'
25
+ * import { Engine } from 'ox'
26
+ * import { Hash } from 'ox/wasm'
25
27
  *
26
- * Engine.set(await WasmHash.create())
28
+ * await Engine.install({ Hash: Hash.engine() })
27
29
  *
28
30
  * Hash.keccak256('0xdeadbeef')
29
31
  * ```
30
32
  *
31
- * @returns An engine supplying the `Hash` slot.
33
+ * @returns The WASM implementation of the `Hash` slot.
32
34
  */
33
- export declare function create(): Promise<create.ReturnType>;
34
- export declare namespace create {
35
- /**
36
- * The `Hash` slot, carrying every primitive this module implements.
37
- *
38
- * {@link ox#Engine.Engine} is optional all the way down so that an engine can
39
- * fill in as little as it likes. This one always fills the same four, and
40
- * saying so is what spares callers a non-null assertion per primitive.
41
- */
35
+ export declare function engine(): Promise<engine.ReturnType>;
36
+ export declare namespace engine {
37
+ /** Every `Hash` primitive this module implements. */
42
38
  type ReturnType = {
43
- Hash: {
44
- [key in 'hmacSha256' | 'keccak256' | 'ripemd160' | 'sha256']-?: NonNullable<Engine.Hash[key]>;
45
- };
39
+ [key in 'blake3' | 'hmacSha256' | 'keccak256' | 'ripemd160' | 'sha256']-?: NonNullable<Engine.Hash[key]>;
46
40
  };
47
41
  type ErrorType = internal.MemoryError | Errors.GlobalErrorType;
48
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../src/wasm/Hash.ts"],"names":[],"mappings":"AAAA,OAA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,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC/C,CAAA;IAED,KAAK,SAAS,GAAG,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,eAAe,CAAA;CAC/D"}
package/dist/wasm/Hash.js CHANGED
@@ -1,24 +1,16 @@
1
+ import * as blake3 from './internal/blake3.js';
1
2
  import * as hash from './internal/hash.js';
2
- import { wasmBase64 } from './internal/hashes.wasm.js';
3
- import * as internal from './internal/instantiate.js';
3
+ import * as hashes from './internal/hashes.js';
4
+ export * from '../core/Hash.js';
4
5
  export { MemoryError } from './internal/instantiate.js';
5
6
  /** Digest sizes, in bytes. */
6
7
  const digestSize = { keccak256: 32, ripemd160: 20, sha256: 32 };
7
8
  /**
8
- * Compilation is memoized; the engine object deliberately is not.
9
+ * Compiles the WASM implementation of the [`Hash`](/api/Hash) primitives,
10
+ * without installing it.
9
11
  *
10
- * Handing every caller the same object means one of them customising a slot
11
- * for composition silently changes what a later `create` -- or `Engine.load`
12
- * -- installs.
13
- *
14
- * @internal
15
- */
16
- const instantiate = /*#__PURE__*/ internal.memoize(() => internal.instantiate(wasmBase64));
17
- /**
18
- * Compiles the WASM implementation of the [`Hash`](/api/Hash) primitives, without
19
- * installing it.
20
- *
21
- * Most callers want {@link ox#Engine.load} instead, which compiles every
12
+ * Most callers want
13
+ * [`Engine.install`](/wasm/crypto/Engine/install) instead, which compiles every
22
14
  * implementation this entrypoint provides and installs them in one call. Reach
23
15
  * for this to take the `Hash` slot on its own, or to hold the implementation
24
16
  * without touching the installed engine.
@@ -32,19 +24,22 @@ const instantiate = /*#__PURE__*/ internal.memoize(() => internal.instantiate(wa
32
24
  * @example
33
25
  * ```ts twoslash
34
26
  * // @noErrors
35
- * import { Engine, Hash } from 'ox'
36
- * import * as WasmHash from 'ox/wasm/Hash'
27
+ * import { Engine } from 'ox'
28
+ * import { Hash } from 'ox/wasm'
37
29
  *
38
- * Engine.set(await WasmHash.create())
30
+ * await Engine.install({ Hash: Hash.engine() })
39
31
  *
40
32
  * Hash.keccak256('0xdeadbeef')
41
33
  * ```
42
34
  *
43
- * @returns An engine supplying the `Hash` slot.
35
+ * @returns The WASM implementation of the `Hash` slot.
44
36
  */
45
- export async function create() {
37
+ export async function engine() {
46
38
  {
47
- const module = await instantiate();
39
+ const [blake3Module, module] = await Promise.all([
40
+ blake3.load(),
41
+ hashes.load(),
42
+ ]);
48
43
  // Copies `input` in, runs `hash`, and copies the digest back out.
49
44
  function call(hash, input) {
50
45
  const out = digestSize[hash];
@@ -58,12 +53,11 @@ export async function create() {
58
53
  return module.view().slice(outPtr, outPtr + out);
59
54
  }
60
55
  return {
61
- Hash: {
62
- hmacSha256: (key, message) => hash.hmacSha256(module, key, message),
63
- keccak256: (input) => call('keccak256', input),
64
- ripemd160: (input) => call('ripemd160', input),
65
- sha256: (input) => call('sha256', input),
66
- },
56
+ blake3: (input) => blake3.hash(blake3Module, input),
57
+ hmacSha256: (key, message) => hash.hmacSha256(module, key, message),
58
+ keccak256: (input) => call('keccak256', input),
59
+ ripemd160: (input) => call('ripemd160', input),
60
+ sha256: (input) => call('sha256', input),
67
61
  };
68
62
  }
69
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../src/wasm/Hash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAQvD,8BAA8B;AAC9B,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AAE/D;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CACtD,QAAQ,C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AC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;QAClD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC;YACnD,UAAU,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;YACnE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;YAC9C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;YAC9C,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;SACzC,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type * as Engine from '../core/Engine.js';
2
+ import type * as Errors from '../core/Errors.js';
3
+ import * as internal from './internal/instantiate.js';
4
+ export * from '../core/Keystore.js';
5
+ export { MemoryError } from './internal/instantiate.js';
6
+ /**
7
+ * Compiles the WASM implementations of the [`Keystore`](/api/Keystore)
8
+ * synchronous key-derivation primitives, without installing them.
9
+ *
10
+ * Most callers can use [`Engine.install`](/wasm/crypto/Engine/install).
11
+ * Install this factory explicitly when an application has benchmarked and
12
+ * selected WASM scrypt.
13
+ *
14
+ * This provider stays synchronous and leaves AES and asynchronous key
15
+ * derivation on Ox's default implementation.
16
+ *
17
+ * Scrypt uses a standalone artifact and grows memory only when called.
18
+ * WebAssembly cannot shrink that capacity. The provider clears its contents
19
+ * and enforces Noble's 1 GiB temporary-workspace limit.
20
+ *
21
+ * The aggregate [`Engine.install`](/wasm/crypto/Engine/install) installs only
22
+ * PBKDF2 from this provider. Install this factory explicitly to opt into
23
+ * scrypt, whose relative performance depends on its parameters and runtime.
24
+ *
25
+ * Copied inputs, derived output, and the complete workspace are cleared after
26
+ * every return or trap.
27
+ *
28
+ * @example
29
+ * ```ts twoslash
30
+ * // @noErrors
31
+ * import { Engine } from 'ox'
32
+ * import { Keystore } from 'ox/wasm'
33
+ *
34
+ * await Engine.install({ Keystore: Keystore.engine() })
35
+ *
36
+ * Keystore.scrypt({ password: 'testpassword' })
37
+ * ```
38
+ *
39
+ * @returns The WASM implementations of synchronous PBKDF2-HMAC-SHA256 and
40
+ * scrypt.
41
+ */
42
+ export declare function engine(): Promise<engine.ReturnType>;
43
+ export declare namespace engine {
44
+ /** The WASM `Keystore` primitives this module implements. */
45
+ type ReturnType = {
46
+ pbkdf2Sha256: NonNullable<Engine.Keystore['pbkdf2Sha256']>;
47
+ scrypt: NonNullable<Engine.Keystore['scrypt']>;
48
+ };
49
+ type ErrorType = internal.MemoryError | Errors.GlobalErrorType;
50
+ }
51
+ //# sourceMappingURL=Keystore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Keystore.d.ts","sourceRoot":"","sources":["../../src/wasm/Keystore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AAIrD,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAUzD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,KAAK,UAAU,GAAG;QAChB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAA;QAC1D,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;KAC/C,CAAA;IAED,KAAK,SAAS,GAAG,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,eAAe,CAAA;CAC/D"}
@@ -0,0 +1,51 @@
1
+ import * as keystore from './internal/keystore.js';
2
+ import * as scrypt from './internal/scrypt.js';
3
+ export * from '../core/Keystore.js';
4
+ export { MemoryError } from './internal/instantiate.js';
5
+ /**
6
+ * Compiles the WASM implementations of the [`Keystore`](/api/Keystore)
7
+ * synchronous key-derivation primitives, without installing them.
8
+ *
9
+ * Most callers can use [`Engine.install`](/wasm/crypto/Engine/install).
10
+ * Install this factory explicitly when an application has benchmarked and
11
+ * selected WASM scrypt.
12
+ *
13
+ * This provider stays synchronous and leaves AES and asynchronous key
14
+ * derivation on Ox's default implementation.
15
+ *
16
+ * Scrypt uses a standalone artifact and grows memory only when called.
17
+ * WebAssembly cannot shrink that capacity. The provider clears its contents
18
+ * and enforces Noble's 1 GiB temporary-workspace limit.
19
+ *
20
+ * The aggregate [`Engine.install`](/wasm/crypto/Engine/install) installs only
21
+ * PBKDF2 from this provider. Install this factory explicitly to opt into
22
+ * scrypt, whose relative performance depends on its parameters and runtime.
23
+ *
24
+ * Copied inputs, derived output, and the complete workspace are cleared after
25
+ * every return or trap.
26
+ *
27
+ * @example
28
+ * ```ts twoslash
29
+ * // @noErrors
30
+ * import { Engine } from 'ox'
31
+ * import { Keystore } from 'ox/wasm'
32
+ *
33
+ * await Engine.install({ Keystore: Keystore.engine() })
34
+ *
35
+ * Keystore.scrypt({ password: 'testpassword' })
36
+ * ```
37
+ *
38
+ * @returns The WASM implementations of synchronous PBKDF2-HMAC-SHA256 and
39
+ * scrypt.
40
+ */
41
+ export async function engine() {
42
+ const [keystoreEngine, scryptModule] = await Promise.all([
43
+ keystore.engine(),
44
+ scrypt.load(),
45
+ ]);
46
+ return {
47
+ ...keystoreEngine,
48
+ scrypt: (password, salt, options) => scrypt.derive(scryptModule, password, salt, options),
49
+ };
50
+ }
51
+ //# sourceMappingURL=Keystore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Keystore.js","sourceRoot":"","sources":["../../src/wasm/Keystore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAE9C,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvD,QAAQ,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,IAAI,EAAE;KACd,CAAC,CAAA;IACF,OAAO;QACL,GAAG,cAAc;QACjB,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAClC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;KACvD,CAAA;AACH,CAAC"}