@theqrl/dilithium5 0.0.4 → 0.0.6
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.
- package/package.json +1 -1
- package/src/sign.js +4 -2
package/package.json
CHANGED
package/src/sign.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import pkg from 'randombytes'; // eslint-disable-line import/no-extraneous-dependencies
|
|
2
2
|
import { SHAKE } from 'sha3'; // eslint-disable-line import/no-extraneous-dependencies
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -47,6 +47,8 @@ import {
|
|
|
47
47
|
import { Poly, polyChallenge, polyNTT } from './poly.js';
|
|
48
48
|
import { packPk, packSig, packSk, unpackPk, unpackSig, unpackSk } from './packing.js';
|
|
49
49
|
|
|
50
|
+
const randomBytes = pkg;
|
|
51
|
+
|
|
50
52
|
export function cryptoSignKeypair(passedSeed, pk, sk) {
|
|
51
53
|
try {
|
|
52
54
|
if (pk.length !== CryptoPublicKeyBytes) {
|
|
@@ -70,7 +72,7 @@ export function cryptoSignKeypair(passedSeed, pk, sk) {
|
|
|
70
72
|
const t0 = new PolyVecK();
|
|
71
73
|
|
|
72
74
|
// Get randomness for rho, rhoPrime and key
|
|
73
|
-
const seed = passedSeed ||
|
|
75
|
+
const seed = passedSeed || randomBytes(SeedBytes);
|
|
74
76
|
|
|
75
77
|
const state = new SHAKE(256);
|
|
76
78
|
let outputLength = 2 * SeedBytes + CRHBytes;
|