-don't make crypto function used in tests only public
This commit is contained in:
parent
f441f16e33
commit
0d786a7875
@ -31,7 +31,6 @@ import {
|
|||||||
csBlind,
|
csBlind,
|
||||||
csUnblind,
|
csUnblind,
|
||||||
csVerify,
|
csVerify,
|
||||||
scalarMultBase25519,
|
|
||||||
deriveSecrets,
|
deriveSecrets,
|
||||||
calcRBlind,
|
calcRBlind,
|
||||||
Edx25519,
|
Edx25519,
|
||||||
@ -50,6 +49,15 @@ import bigint from "big-integer";
|
|||||||
import { AssertionError } from "assert";
|
import { AssertionError } from "assert";
|
||||||
import BigInteger from "big-integer";
|
import BigInteger from "big-integer";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for testing, simple scalar multiplication with base point of Ed25519
|
||||||
|
* @param s scalar
|
||||||
|
* @returns new point sG
|
||||||
|
*/
|
||||||
|
async function scalarMultBase25519(s: Uint8Array): Promise<Uint8Array> {
|
||||||
|
return nacl.crypto_scalarmult_ed25519_base_noclamp(s);
|
||||||
|
}
|
||||||
|
|
||||||
test("encoding", (t) => {
|
test("encoding", (t) => {
|
||||||
const s = "Hello, World";
|
const s = "Hello, World";
|
||||||
const encStr = encodeCrock(stringToBytes(s));
|
const encStr = encodeCrock(stringToBytes(s));
|
||||||
|
@ -430,15 +430,6 @@ export function deriveSecrets(bseed: Uint8Array): CsBlindingSecrets {
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Used for testing, simple scalar multiplication with base point of Ed25519
|
|
||||||
* @param s scalar
|
|
||||||
* @returns new point sG
|
|
||||||
*/
|
|
||||||
export async function scalarMultBase25519(s: Uint8Array): Promise<Uint8Array> {
|
|
||||||
return nacl.crypto_scalarmult_ed25519_base_noclamp(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calculation of the blinded public point R in CS
|
* calculation of the blinded public point R in CS
|
||||||
* @param csPub denomination publik key
|
* @param csPub denomination publik key
|
||||||
|
Loading…
Reference in New Issue
Block a user