diff --git a/src/binary_formats.ml b/src/binary_formats.ml index 5de8bb9f..a71bd535 100644 --- a/src/binary_formats.ml +++ b/src/binary_formats.ml @@ -1,6 +1,9 @@ (* https://docs.taler.net/core/api-common.html#binary-formats - numeric values are in network byte order (big endian) *) +(* TODO: ? + some struct have a 'P' suffix, but are not defined in doc + we assume they are = to the un-suffixed ones *) open Include @@ -138,7 +141,21 @@ module NormalizedPaytoHash = MK_32 () module AgeCommitmentHash = MK_64 () (* TODO Taler doc: missing *) -module RefreshCommitmentP = MK_64 () +module PublicRefreshCoinNonceP = MK_64 () + +(* TODO Taler doc: missing *) +module PursePublicKey = MK_32 () + +(* TODO Taler doc: missing *) +module AuditorPublicKeyP = MK_32 () + +(* TODO + // Secret for blinding/unblinding. + // An RSA blinding secret, which is basically + // a 256-bit nonce, converted to Crockford `Base32`. + type DenominationBlindingKeyP = string; +*) +module DenominationBlindingKeyP = MK_64 () (* Hash over: a) the hash of the denomination's public key, @@ -156,8 +173,8 @@ module MerchantPublicKeyP = MK_32 () module MerchantPrivateKeyP = MK_32 () (*module MerchantSignatureP = MK_64 () *) -module TransfertPublicKeyP = MK_32 () -module TransfertPrivateKeyP = MK_32 () +module TransferPublicKeyP = MK_32 () +module TransferPrivateKeyP = MK_32 () (* enum TALER_AmlDecisionState { @@ -173,7 +190,7 @@ module ExchangeSignatureP = MK_64 () module MasterPublicKeyP = MK_32 () module MasterPrivateKeyP = MK_32 () module MasterSignatureP = MK_64 () -module WireTransfertIdentifierRawP = MK_BASIC_32 () +module WireTransferIdentifierRawP = MK_BASIC_32 () module UUID = struct (* uint32t value[4]; *) @@ -225,7 +242,7 @@ struct TALER_EncryptedLinkSecretP { uint8t enc[sizeof (struct TALER_LinkSecretP)]; }; *) -module TransfertSecretP = MK_64 () +module TransferSecretP = MK_64 () module LinkSecretP = MK_64 () module EncryptedLinkSecretP = MK_64 () @@ -526,6 +543,8 @@ module DepositConfirmationPS = struct } end +module RefreshCommitmentP = MK_64 () + module RefreshMeltCoinAffirmationPS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT *) (* Hash over: @@ -630,7 +649,7 @@ module MasterDrainProfitPS = struct date: Time.AbsoluteNBO.t; amount: AmountNBO.t; h_section: HashCode.t; - h_payto: FullPaytoHashP.t; + h_payto: FullPaytoHash.t; } end @@ -846,16 +865,12 @@ module ReserveCloseRequestSignaturePS = struct type t = unit end -module RefreshCommitmentP = struct - type t = { session_hash: HashCode.t } -end - module PurseRequestSignaturePS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE *) type t = { purse_expiration: Time.AbsoluteNBO.t; merge_value_after_fees: AmountNBO.t; - h_contract_terms: PrivateContractHashP.t; + h_contract_terms: PrivateContractHash.t; min_age: int; } end @@ -866,7 +881,7 @@ module PurseDepositSignaturePS = struct coin_contribution: AmountNBO.t; h_denom_pub: DenominationHash.t; h_age_commitment: AgeCommitmentHash.t; - purse_pub: PursePublicKeyP.t; + purse_pub: PursePublicKey.t; h_exchange_base_url: HashCode.t; } end @@ -884,9 +899,9 @@ module PurseDepositConfirmedSignaturePS = struct type t = { total_purse_amount: AmountNBO.t; total_deposit_fees: AmountNBO.t; - purse_pub: PursePublicKeyP.t; + purse_pub: PursePublicKey.t; purse_expiration: Time.AbsoluteNBO.t; - h_contract_terms: PrivateContractHashP.t; + h_contract_terms: PrivateContractHash.t; } end @@ -894,7 +909,7 @@ module PurseMergeSignaturePS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE *) type t = { merge_timestamp: Time.AbsoluteNBO.t; - h_wire: NormalizedPaytoHashP.t; + h_wire: NormalizedPaytoHash.t; } end @@ -902,11 +917,11 @@ module AccountMergeSignaturePS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE *) type t = { reserve_pub: ReservePublicKeyP.t; - purse_pub: PursePublicKeyP.t; + purse_pub: PursePublicKey.t; merge_amount_after_fees: AmountNBO.t; merge_timestamp: Time.AbsoluteNBO.t; purse_expiration: Time.AbsoluteNBO.t; - h_contract_terms: PrivateContractHashP.t; + h_contract_terms: PrivateContractHash.t; min_age: int; } end @@ -920,11 +935,11 @@ module PurseMergeSuccessSignaturePS = struct (* purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS *) type t = { reserve_pub: ReservePublicKeyP.t; - purse_pub: PursePublicKeyP.t; + purse_pub: PursePublicKey.t; merge_amount_after_fees: AmountNBO.t; contract_time: Time.AbsoluteNBO.t; - h_contract_terms: PrivateContractHashP.t; - h_wire: NormalizedPaytoHashP.t; + h_contract_terms: PrivateContractHash.t; + h_wire: NormalizedPaytoHash.t; min_age: int; } end @@ -1057,7 +1072,7 @@ module AmlDecisionPS = struct h_justification: HashCode.t; decision_time: Time.TimestampNBO.t; new_threshold: AmountNBO.t; - h_payto: NormalizedPaytoHashP.t; + h_payto: NormalizedPaytoHash.t; h_kyc_requirements: HashCode.t; new_state: int; } @@ -1089,7 +1104,7 @@ module ReserveClosePS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE *) type t = { request_timestamp: Time.TimestampNBO.t; - target_account_h_payto: FullPaytoHashP.t; + target_account_h_payto: FullPaytoHash.t; } end diff --git a/src/types.ml b/src/types.ml index d1f43f96..415b6dcb 100644 --- a/src/types.ml +++ b/src/types.ml @@ -116,6 +116,8 @@ module Eddsa = struct (* EdDSA and ECDHE public keys always point on Curve25519 and represented using the standard 256 bits Ed25519 compact format, converted to Crockford Base32. *) + (* EdDSA signatures are transmitted as 64-bytes `base32` + binary-encoded objects with just the R and S values (base32_ binary-only). *) type pub = Mirage_crypto_ec.Ed25519.pub let pub_of_string s =