From b91caf977fad8da11e523ca3a39064dd86e04c64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 16 Sep 2022 16:20:47 +0200 Subject: wallet-core: support age restrictions in new coin selection --- packages/taler-util/src/talerCrypto.ts | 5 +++++ packages/taler-util/src/walletTypes.ts | 1 + 2 files changed, 6 insertions(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/talerCrypto.ts b/packages/taler-util/src/talerCrypto.ts index 8d2e41793..c9eeb0584 100644 --- a/packages/taler-util/src/talerCrypto.ts +++ b/packages/taler-util/src/talerCrypto.ts @@ -988,6 +988,11 @@ function invariant(cond: boolean): asserts cond { } export namespace AgeRestriction { + /** + * Smallest age value that the protocol considers "unrestricted". + */ + export const AGE_UNRESTRICTED = 32; + export function hashCommitment(ac: AgeCommitment): HashCodeString { const hc = new nacl.HashState(); for (const pub of ac.publicKeys) { diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts index c3e5c6ed0..6dcaac78d 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/walletTypes.ts @@ -1226,6 +1226,7 @@ export interface RefreshPlanchetInfo { */ blindingKey: string; + maxAge: number; ageCommitmentProof?: AgeCommitmentProof; } -- cgit v1.2.3