From 07cdfb2e4ec761021477271776b81f33af0e731d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 17 Mar 2021 17:56:37 +0100 Subject: towards wallet-core / util split --- .../taler-wallet-core/src/crypto/cryptoTypes.ts | 141 +++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 packages/taler-wallet-core/src/crypto/cryptoTypes.ts (limited to 'packages/taler-wallet-core/src/crypto/cryptoTypes.ts') diff --git a/packages/taler-wallet-core/src/crypto/cryptoTypes.ts b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts new file mode 100644 index 000000000..922fbbfac --- /dev/null +++ b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts @@ -0,0 +1,141 @@ +/* + This file is part of GNU Taler + (C) 2020 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see + */ + +/** + * Types used by the wallet crypto worker. + * + * These types are defined in a separate file make tree shaking easier, since + * some components use these types (via RPC) but do not depend on the wallet + * code directly. + * + * @author Florian Dold + */ + +/** + * Imports. + */ +import { AmountJson } from "@gnu-taler/taler-util"; + +export interface RefreshNewDenomInfo { + count: number; + value: AmountJson; + feeWithdraw: AmountJson; + denomPub: string; +} + +/** + * Request to derive a refresh session from the refresh session + * secret seed. + */ +export interface DeriveRefreshSessionRequest { + sessionSecretSeed: string; + kappa: number; + meltCoinPub: string; + meltCoinPriv: string; + meltCoinDenomPubHash: string; + newCoinDenoms: RefreshNewDenomInfo[]; + feeRefresh: AmountJson; +} + +/** + * + */ +export interface DerivedRefreshSession { + /** + * Public key that's being melted in this session. + */ + meltCoinPub: string; + + /** + * Signature to confirm the melting. + */ + confirmSig: string; + + /** + * Planchets for each cut-and-choose instance. + */ + planchetsForGammas: { + /** + * Public key for the coin. + */ + publicKey: string; + + /** + * Private key for the coin. + */ + privateKey: string; + + /** + * Blinded public key. + */ + coinEv: string; + + /** + * Hash of the blinded public key. + */ + coinEvHash: string; + + /** + * Blinding key used. + */ + blindingKey: string; + }[][]; + + /** + * The transfer keys, kappa of them. + */ + transferPubs: string[]; + + /** + * Private keys for the transfer public keys. + */ + transferPrivs: string[]; + + /** + * Hash of the session. + */ + hash: string; + + /** + * Exact value that is being melted. + */ + meltValueWithFee: AmountJson; +} + +export interface DeriveTipRequest { + secretSeed: string; + denomPub: string; + planchetIndex: number; +} + +/** + * Tipping planchet stored in the database. + */ +export interface DerivedTipPlanchet { + blindingKey: string; + coinEv: string; + coinEvHash: string; + coinPriv: string; + coinPub: string; +} + +export interface SignTrackTransactionRequest { + contractTermsHash: string; + wireHash: string; + coinPub: string; + merchantPriv: string; + merchantPub: string; +} -- cgit v1.2.3