@webpqc/fndsa 0.0.1 → 0.1.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.
@@ -19,4 +19,6 @@ export declare function assertBytes(value: unknown, name: string): void;
19
19
  * a SharedArrayBuffer which another thread writes to.
20
20
  */
21
21
  export declare function copyBytes(value: Uint8Array): Uint8Array;
22
+ /** The Web Cryptography API of the runtime, which gives the random values. */
23
+ export declare function getCrypto(): Crypto;
22
24
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/src/utils.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEvD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/src/utils.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEvD;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
package/esm/src/utils.js CHANGED
@@ -42,3 +42,10 @@ export function assertBytes(value, name) {
42
42
  export function copyBytes(value) {
43
43
  return new Uint8Array(value);
44
44
  }
45
+ /** The Web Cryptography API of the runtime, which gives the random values. */
46
+ export function getCrypto() {
47
+ if (globalThis.crypto === undefined) {
48
+ throw new Error("Web Crypto API is not available");
49
+ }
50
+ return globalThis.crypto;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpqc/fndsa",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "An experimental FN-DSA (Falcon) implementation written in TypeScript for various JavaScript runtimes",
5
5
  "keywords": [
6
6
  "fn-dsa",