diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | 12 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/crypto/cryptoTypes.ts | 1 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index c21ee99e8..bfc48d961 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -743,9 +743,16 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { if (req.denomPub.cipher !== DenomKeyType.Rsa) { throw Error(`unsupported cipher (${req.denomPub.cipher})`); } - const fc = setupTipPlanchet(decodeCrock(req.secretSeed), req.planchetIndex); + const fc = await setupTipPlanchet( + decodeCrock(req.secretSeed), + req.denomPub, + req.planchetIndex, + ); + const maybeAch = fc.ageCommitmentProof + ? AgeRestriction.hashCommitment(fc.ageCommitmentProof.commitment) + : undefined; const denomPub = decodeCrock(req.denomPub.rsa_public_key); - const coinPubHash = hash(fc.coinPub); + const coinPubHash = hashCoinPub(encodeCrock(fc.coinPub), maybeAch); const blindResp = await tci.rsaBlind(tci, { bks: encodeCrock(fc.bks), hm: encodeCrock(coinPubHash), @@ -763,6 +770,7 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { ), coinPriv: encodeCrock(fc.coinPriv), coinPub: encodeCrock(fc.coinPub), + ageCommitmentProof: fc.ageCommitmentProof, }; return tipPlanchet; }, diff --git a/packages/taler-wallet-core/src/crypto/cryptoTypes.ts b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts index 4c75aa91e..0858cffa9 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoTypes.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts @@ -122,6 +122,7 @@ export interface DerivedTipPlanchet { coinEvHash: string; coinPriv: string; coinPub: string; + ageCommitmentProof: AgeCommitmentProof | undefined; } export interface SignTrackTransactionRequest { diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index 571721658..a0fd8d328 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -319,6 +319,7 @@ export async function processTip( status: CoinStatus.Fresh, coinEvHash: planchet.coinEvHash, maxAge: AgeRestriction.AGE_UNRESTRICTED, + ageCommitmentProof: planchet.ageCommitmentProof, }); } |