summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/talerCrypto.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/talerCrypto.ts')
-rw-r--r--packages/taler-util/src/talerCrypto.ts39
1 files changed, 4 insertions, 35 deletions
diff --git a/packages/taler-util/src/talerCrypto.ts b/packages/taler-util/src/talerCrypto.ts
index 4d6e73671..0385658ca 100644
--- a/packages/taler-util/src/talerCrypto.ts
+++ b/packages/taler-util/src/talerCrypto.ts
@@ -692,7 +692,7 @@ export interface FreshCoin {
bks: Uint8Array;
}
-function bufferForUint32(n: number): Uint8Array {
+export function bufferForUint32(n: number): Uint8Array {
const arrBuf = new ArrayBuffer(4);
const buf = new Uint8Array(arrBuf);
const dv = new DataView(arrBuf);
@@ -700,37 +700,6 @@ function bufferForUint32(n: number): Uint8Array {
return buf;
}
-export function setupRefreshPlanchet(
- transferSecret: Uint8Array,
- coinNumber: number,
-): FreshCoin {
- // See TALER_transfer_secret_to_planchet_secret in C impl
- const planchetMasterSecret = kdfKw({
- ikm: transferSecret,
- outputLength: 32,
- salt: bufferForUint32(coinNumber),
- info: stringToBytes("taler-coin-derivation"),
- });
-
- const coinPriv = kdfKw({
- ikm: planchetMasterSecret,
- outputLength: 32,
- salt: stringToBytes("coin"),
- });
-
- const bks = kdfKw({
- ikm: planchetMasterSecret,
- outputLength: 32,
- salt: stringToBytes("bks"),
- });
-
- return {
- bks,
- coinPriv,
- coinPub: eddsaGetPublic(coinPriv),
- };
-}
-
export function setupWithdrawPlanchet(
secretSeed: Uint8Array,
coinNumber: number,
@@ -786,10 +755,10 @@ export function setupRefreshTransferPub(
}
/**
- *
+ *
* @param paytoUri
- * @param salt 16-byte salt
- * @returns
+ * @param salt 16-byte salt
+ * @returns
*/
export function hashWire(paytoUri: string, salt: string): string {
const r = kdf(