Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions confidential-transfer/proof-extraction/src/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use {
/// The public keys associated with a confidential burn
pub struct BurnPubkeys {
pub source: PodElGamalPubkey,
pub auditor: PodElGamalPubkey,
pub supply: PodElGamalPubkey,
pub auditor: PodElGamalPubkey,
}

/// The proof context information needed to process a confidential burn
Expand Down Expand Up @@ -51,8 +51,8 @@ impl BurnProofContext {
// `BurnProofContext`.
let BatchedGroupedCiphertext3HandlesValidityProofContext {
first_pubkey: source_elgamal_pubkey_from_validity_proof,
second_pubkey: auditor_elgamal_pubkey,
third_pubkey: supply_elgamal_pubkey,
second_pubkey: supply_elgamal_pubkey,
third_pubkey: auditor_elgamal_pubkey,
grouped_ciphertext_lo: burn_amount_ciphertext_lo,
grouped_ciphertext_hi: burn_amount_ciphertext_hi,
} = ciphertext_validity_proof_context;
Expand Down Expand Up @@ -116,8 +116,8 @@ impl BurnProofContext {

let burn_pubkeys = BurnPubkeys {
source: *source_elgamal_pubkey_from_equality_proof,
auditor: *auditor_elgamal_pubkey,
supply: *supply_elgamal_pubkey,
auditor: *auditor_elgamal_pubkey,
};

Ok(BurnProofContext {
Expand Down
8 changes: 4 additions & 4 deletions confidential-transfer/proof-extraction/src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use {
/// The public keys associated with a confidential mint
pub struct MintPubkeys {
pub destination: PodElGamalPubkey,
pub auditor: PodElGamalPubkey,
pub supply: PodElGamalPubkey,
pub auditor: PodElGamalPubkey,
}

/// The proof context information needed to process a confidential mint
Expand Down Expand Up @@ -49,8 +49,8 @@ impl MintProofContext {
// fields should be returned as part of `MintProofContext`.
let BatchedGroupedCiphertext3HandlesValidityProofContext {
first_pubkey: destination_elgamal_pubkey,
second_pubkey: auditor_elgamal_pubkey,
third_pubkey: supply_elgamal_pubkey_from_ciphertext_validity_proof,
second_pubkey: supply_elgamal_pubkey_from_ciphertext_validity_proof,
third_pubkey: auditor_elgamal_pubkey,
grouped_ciphertext_lo: mint_amount_ciphertext_lo,
grouped_ciphertext_hi: mint_amount_ciphertext_hi,
} = ciphertext_validity_proof_context;
Expand Down Expand Up @@ -116,8 +116,8 @@ impl MintProofContext {

let mint_pubkeys = MintPubkeys {
destination: *destination_elgamal_pubkey,
auditor: *auditor_elgamal_pubkey,
supply: *supply_elgamal_pubkey_from_equality_proof,
auditor: *auditor_elgamal_pubkey,
};

Ok(MintProofContext {
Expand Down
8 changes: 4 additions & 4 deletions confidential-transfer/proof-generation/src/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub fn burn_split_proof_data(
burn_amount: u64,
source_elgamal_keypair: &ElGamalKeypair,
source_aes_key: &AeKey,
auditor_elgamal_pubkey: Option<&ElGamalPubkey>,
supply_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: Option<&ElGamalPubkey>,
) -> Result<BurnProofData, TokenProofGenerationError> {
let default_auditor_pubkey = ElGamalPubkey::default();
let auditor_elgamal_pubkey = auditor_elgamal_pubkey.unwrap_or(&default_auditor_pubkey);
Expand All @@ -50,15 +50,15 @@ pub fn burn_split_proof_data(
let (burn_amount_ciphertext_lo, burn_amount_opening_lo) = BurnAmountCiphertext::new(
burn_amount_lo,
source_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
supply_elgamal_pubkey,
auditor_elgamal_pubkey,
);

let (burn_amount_ciphertext_hi, burn_amount_opening_hi) = BurnAmountCiphertext::new(
burn_amount_hi,
source_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
supply_elgamal_pubkey,
auditor_elgamal_pubkey,
);

// decrypt the current available balance at the source
Expand Down Expand Up @@ -106,8 +106,8 @@ pub fn burn_split_proof_data(
// generate ciphertext validity data
let ciphertext_validity_proof_data = BatchedGroupedCiphertext3HandlesValidityProofData::new(
source_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
supply_elgamal_pubkey,
auditor_elgamal_pubkey,
&burn_amount_ciphertext_lo.0,
&burn_amount_ciphertext_hi.0,
burn_amount_lo,
Expand Down
8 changes: 4 additions & 4 deletions confidential-transfer/proof-generation/src/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ impl BurnAmountCiphertext {
pub fn new(
amount: u64,
source_pubkey: &ElGamalPubkey,
auditor_pubkey: &ElGamalPubkey,
supply_pubkey: &ElGamalPubkey,
auditor_pubkey: &ElGamalPubkey,
) -> (Self, PedersenOpening) {
let opening = PedersenOpening::new_rand();
let grouped_ciphertext = GroupedElGamal::<3>::encrypt_with(
[source_pubkey, auditor_pubkey, supply_pubkey],
[source_pubkey, supply_pubkey, auditor_pubkey],
amount,
&opening,
);
Expand All @@ -121,12 +121,12 @@ impl MintAmountCiphertext {
pub fn new(
amount: u64,
source_pubkey: &ElGamalPubkey,
auditor_pubkey: &ElGamalPubkey,
supply_pubkey: &ElGamalPubkey,
auditor_pubkey: &ElGamalPubkey,
) -> (Self, PedersenOpening) {
let opening = PedersenOpening::new_rand();
let grouped_ciphertext = GroupedElGamal::<3>::encrypt_with(
[source_pubkey, auditor_pubkey, supply_pubkey],
[source_pubkey, supply_pubkey, auditor_pubkey],
amount,
&opening,
);
Expand Down
10 changes: 5 additions & 5 deletions confidential-transfer/proof-generation/src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ pub fn mint_split_proof_data(
let (mint_amount_grouped_ciphertext_lo, mint_amount_opening_lo) = MintAmountCiphertext::new(
mint_amount_lo,
destination_elgamal_pubkey,
auditor_elgamal_pubkey,
supply_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
);

let (mint_amount_grouped_ciphertext_hi, mint_amount_opening_hi) = MintAmountCiphertext::new(
mint_amount_hi,
destination_elgamal_pubkey,
auditor_elgamal_pubkey,
supply_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
);

// compute the new supply ciphertext
let mint_amount_ciphertext_supply_lo = mint_amount_grouped_ciphertext_lo
.0
.to_elgamal_ciphertext(2)
.to_elgamal_ciphertext(1)
.unwrap();
let mint_amount_ciphertext_supply_hi = mint_amount_grouped_ciphertext_hi
.0
.to_elgamal_ciphertext(2)
.to_elgamal_ciphertext(1)
.unwrap();

#[allow(clippy::arithmetic_side_effects)]
Expand Down Expand Up @@ -99,8 +99,8 @@ pub fn mint_split_proof_data(
// generate ciphertext validity proof data
let ciphertext_validity_proof_data = BatchedGroupedCiphertext3HandlesValidityProofData::new(
destination_elgamal_pubkey,
auditor_elgamal_pubkey,
supply_elgamal_keypair.pubkey(),
auditor_elgamal_pubkey,
&mint_amount_grouped_ciphertext_lo.0,
&mint_amount_grouped_ciphertext_hi.0,
mint_amount_lo,
Expand Down
2 changes: 1 addition & 1 deletion confidential-transfer/proof-tests/tests/proof_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ fn test_burn_validity(spendable_balance: u64, burn_amount: u64) {
burn_amount,
&source_keypair,
&aes_key,
Some(auditor_pubkey),
supply_pubkey,
Some(auditor_pubkey),
)
.unwrap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ impl BurnAccountInfo {
burn_amount,
source_elgamal_keypair,
aes_key,
auditor_elgamal_pubkey,
supply_elgamal_pubkey,
auditor_elgamal_pubkey,
)
.map_err(|e| -> TokenError { e.into() })
}
Expand Down
Loading