diff options
Diffstat (limited to 'packages/taler-util/src/taler-crypto.ts')
-rw-r--r-- | packages/taler-util/src/taler-crypto.ts | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/packages/taler-util/src/taler-crypto.ts b/packages/taler-util/src/taler-crypto.ts index 66ad478d3..db64efcf2 100644 --- a/packages/taler-util/src/taler-crypto.ts +++ b/packages/taler-util/src/taler-crypto.ts @@ -71,11 +71,20 @@ interface NativeTartLib { ecdheGetPublic(buf: Uint8Array): Uint8Array; eddsaSign(msg: Uint8Array, priv: Uint8Array): Uint8Array; eddsaVerify(msg: Uint8Array, sig: Uint8Array, pub: Uint8Array): boolean; - kdf(outLen: number, ikm: Uint8Array, salt?: Uint8Array, info?: Uint8Array): Uint8Array; + kdf( + outLen: number, + ikm: Uint8Array, + salt?: Uint8Array, + info?: Uint8Array, + ): Uint8Array; keyExchangeEcdhEddsa(ecdhPriv: Uint8Array, eddsaPub: Uint8Array): Uint8Array; keyExchangeEddsaEcdh(eddsaPriv: Uint8Array, ecdhPub: Uint8Array): Uint8Array; rsaBlind(hmsg: Uint8Array, bks: Uint8Array, rsaPub: Uint8Array): Uint8Array; - rsaUnblind(blindSig: Uint8Array, rsaPub: Uint8Array, bks: Uint8Array): Uint8Array; + rsaUnblind( + blindSig: Uint8Array, + rsaPub: Uint8Array, + bks: Uint8Array, + ): Uint8Array; rsaVerify(hmsg: Uint8Array, rsaSig: Uint8Array, rsaPub: Uint8Array): boolean; hashStateInit(): any; hashStateUpdate(st: any, data: Uint8Array): any; @@ -168,7 +177,7 @@ export function kdf( info?: Uint8Array, ): Uint8Array { if (tart) { - return tart.kdf(outputLength, ikm, salt, info) + return tart.kdf(outputLength, ikm, salt, info); } salt = salt ?? new Uint8Array(64); // extract @@ -199,7 +208,6 @@ export function kdf( return output.slice(0, outputLength); } - /** * HMAC-SHA512-SHA256 (see RFC 5869). */ @@ -460,7 +468,7 @@ export function rsaUnblind( bks: Uint8Array, ): Uint8Array { if (tart) { - return tart.rsaUnblind(sig, rsaPubEnc, bks) + return tart.rsaUnblind(sig, rsaPubEnc, bks); } const rsaPub = rsaPubDecode(rsaPubEnc); const blinded_s = loadBigInt(sig); @@ -839,7 +847,7 @@ export function createHashContext(): TalerHashState { return { finish: () => t.hashStateFinish(st), update: (d) => t.hashStateUpdate(st, d), - } + }; } return new nacl.HashState(); } |