diff options
author | Florian Dold <florian@dold.me> | 2022-09-16 16:20:47 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-09-16 16:32:21 +0200 |
commit | b91caf977fad8da11e523ca3a39064dd86e04c64 (patch) | |
tree | 732e1543d2555094d7f9a9ca242309847c1a33a3 /packages/taler-util/src | |
parent | 2747bc260bc05418974570d04d7f999dfc988cda (diff) | |
download | wallet-core-b91caf977fad8da11e523ca3a39064dd86e04c64.tar.xz |
wallet-core: support age restrictions in new coin selection
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/talerCrypto.ts | 5 | ||||
-rw-r--r-- | packages/taler-util/src/walletTypes.ts | 1 |
2 files changed, 6 insertions, 0 deletions
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; } |