Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 2bfa851

Browse files
committed
update to CiphertextValidityProofWithAuditorCiphertext
1 parent 3ccab77 commit 2bfa851

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

token/confidential-transfer/proof-generation/src/burn.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use {
22
crate::{
33
encryption::BurnAmountCiphertext, errors::TokenProofGenerationError,
4-
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithCiphertext,
4+
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithAuditorCiphertext,
55
},
66
solana_zk_sdk::{
77
encryption::{
@@ -25,7 +25,8 @@ const RANGE_PROOF_PADDING_BIT_LENGTH: usize = 16;
2525
/// The proof data required for a confidential burn instruction
2626
pub struct BurnProofData {
2727
pub equality_proof_data: CiphertextCommitmentEqualityProofData,
28-
pub ciphertext_validity_proof_data_with_ciphertext: CiphertextValidityProofWithCiphertext,
28+
pub ciphertext_validity_proof_data_with_ciphertext:
29+
CiphertextValidityProofWithAuditorCiphertext,
2930
pub range_proof_data: BatchedRangeProofU128Data,
3031
}
3132

@@ -125,11 +126,12 @@ pub fn burn_split_proof_data(
125126
.try_extract_ciphertext(2)
126127
.map_err(|_| TokenProofGenerationError::CiphertextExtraction)?;
127128

128-
let ciphertext_validity_proof_data_with_ciphertext = CiphertextValidityProofWithCiphertext {
129-
proof_data: ciphertext_validity_proof_data,
130-
ciphertext_lo: burn_amount_auditor_ciphertext_lo,
131-
ciphertext_hi: burn_amount_auditor_ciphertext_hi,
132-
};
129+
let ciphertext_validity_proof_data_with_ciphertext =
130+
CiphertextValidityProofWithAuditorCiphertext {
131+
proof_data: ciphertext_validity_proof_data,
132+
ciphertext_lo: burn_amount_auditor_ciphertext_lo,
133+
ciphertext_hi: burn_amount_auditor_ciphertext_hi,
134+
};
133135

134136
// generate range proof data
135137
let (padding_commitment, padding_opening) = Pedersen::new(0_u64);

token/confidential-transfer/proof-generation/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ pub fn try_combine_lo_hi_openings(
9696
/// ciphertexts.
9797
///
9898
/// Ciphertext validity proof data contains grouped ElGamal ciphertexts (`lo`
99-
/// and `hi`) and a proof containing the
100-
/// validity of these ciphertexts. Token client-side logic often requires a
101-
/// function to extract specific forms of the grouped ElGamal ciphertexts. This
102-
/// type is a convenience type that contains the proof data and the extracted
103-
/// ciphertexts.
99+
/// and `hi`) and a proof containing the validity of these ciphertexts. Token
100+
/// client-side logic often requires a function to extract specific forms of
101+
/// the grouped ElGamal ciphertexts. This type is a convenience type that
102+
/// contains the proof data and the extracted ciphertexts.
104103
#[derive(Clone, Copy)]
105-
pub struct CiphertextValidityProofWithCiphertext {
104+
pub struct CiphertextValidityProofWithAuditorCiphertext {
106105
pub proof_data: BatchedGroupedCiphertext3HandlesValidityProofData,
107106
pub ciphertext_lo: PodElGamalCiphertext,
108107
pub ciphertext_hi: PodElGamalCiphertext,

token/confidential-transfer/proof-generation/src/mint.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use {
22
crate::{
33
encryption::MintAmountCiphertext, errors::TokenProofGenerationError,
4-
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithCiphertext,
4+
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithAuditorCiphertext,
55
},
66
solana_zk_sdk::{
77
encryption::{
@@ -25,7 +25,8 @@ const RANGE_PROOF_PADDING_BIT_LENGTH: usize = 16;
2525
/// The proof data required for a confidential mint instruction
2626
pub struct MintProofData {
2727
pub equality_proof_data: CiphertextCommitmentEqualityProofData,
28-
pub ciphertext_validity_proof_data_with_ciphertext: CiphertextValidityProofWithCiphertext,
28+
pub ciphertext_validity_proof_data_with_ciphertext:
29+
CiphertextValidityProofWithAuditorCiphertext,
2930
pub range_proof_data: BatchedRangeProofU128Data,
3031
pub new_decryptable_supply: AeCiphertext,
3132
}
@@ -121,11 +122,12 @@ pub fn mint_split_proof_data(
121122
.try_extract_ciphertext(2)
122123
.map_err(|_| TokenProofGenerationError::CiphertextExtraction)?;
123124

124-
let ciphertext_validity_proof_data_with_ciphertext = CiphertextValidityProofWithCiphertext {
125-
proof_data: ciphertext_validity_proof_data,
126-
ciphertext_lo: mint_amount_auditor_ciphertext_lo,
127-
ciphertext_hi: mint_amount_auditor_ciphertext_hi,
128-
};
125+
let ciphertext_validity_proof_data_with_ciphertext =
126+
CiphertextValidityProofWithAuditorCiphertext {
127+
proof_data: ciphertext_validity_proof_data,
128+
ciphertext_lo: mint_amount_auditor_ciphertext_lo,
129+
ciphertext_hi: mint_amount_auditor_ciphertext_hi,
130+
};
129131

130132
// generate range proof data
131133
let (padding_commitment, padding_opening) = Pedersen::new(0_u64);

token/confidential-transfer/proof-generation/src/transfer.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use {
22
crate::{
33
encryption::TransferAmountCiphertext, errors::TokenProofGenerationError,
4-
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithCiphertext,
4+
try_combine_lo_hi_ciphertexts, try_split_u64, CiphertextValidityProofWithAuditorCiphertext,
55
REMAINING_BALANCE_BIT_LENGTH, TRANSFER_AMOUNT_HI_BITS, TRANSFER_AMOUNT_LO_BITS,
66
},
77
solana_zk_sdk::{
@@ -25,7 +25,8 @@ const RANGE_PROOF_PADDING_BIT_LENGTH: usize = 16;
2525
/// mint is not extended for fees
2626
pub struct TransferProofData {
2727
pub equality_proof_data: CiphertextCommitmentEqualityProofData,
28-
pub ciphertext_validity_proof_data_with_ciphertext: CiphertextValidityProofWithCiphertext,
28+
pub ciphertext_validity_proof_data_with_ciphertext:
29+
CiphertextValidityProofWithAuditorCiphertext,
2930
pub range_proof_data: BatchedRangeProofU128Data,
3031
}
3132

@@ -132,11 +133,12 @@ pub fn transfer_split_proof_data(
132133
.try_extract_ciphertext(2)
133134
.map_err(|_| TokenProofGenerationError::CiphertextExtraction)?;
134135

135-
let ciphertext_validity_proof_data_with_ciphertext = CiphertextValidityProofWithCiphertext {
136-
proof_data: ciphertext_validity_proof_data,
137-
ciphertext_lo: transfer_amount_auditor_ciphertext_lo,
138-
ciphertext_hi: transfer_amount_auditor_ciphertext_hi,
139-
};
136+
let ciphertext_validity_proof_data_with_ciphertext =
137+
CiphertextValidityProofWithAuditorCiphertext {
138+
proof_data: ciphertext_validity_proof_data,
139+
ciphertext_lo: transfer_amount_auditor_ciphertext_lo,
140+
ciphertext_hi: transfer_amount_auditor_ciphertext_hi,
141+
};
140142

141143
// generate range proof data
142144
let (padding_commitment, padding_opening) = Pedersen::new(0_u64);

token/confidential-transfer/proof-generation/src/transfer_with_fee.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use {
33
encryption::{FeeCiphertext, TransferAmountCiphertext},
44
errors::TokenProofGenerationError,
55
try_combine_lo_hi_ciphertexts, try_combine_lo_hi_commitments, try_combine_lo_hi_openings,
6-
try_split_u64, CiphertextValidityProofWithCiphertext, TRANSFER_AMOUNT_HI_BITS,
6+
try_split_u64, CiphertextValidityProofWithAuditorCiphertext, TRANSFER_AMOUNT_HI_BITS,
77
TRANSFER_AMOUNT_LO_BITS,
88
},
99
curve25519_dalek::scalar::Scalar,
@@ -36,7 +36,7 @@ const DELTA_BIT_LENGTH: usize = 48;
3636
pub struct TransferWithFeeProofData {
3737
pub equality_proof_data: CiphertextCommitmentEqualityProofData,
3838
pub transfer_amount_ciphertext_validity_proof_data_with_ciphertext:
39-
CiphertextValidityProofWithCiphertext,
39+
CiphertextValidityProofWithAuditorCiphertext,
4040
pub percentage_with_cap_proof_data: PercentageWithCapProofData,
4141
pub fee_ciphertext_validity_proof_data: BatchedGroupedCiphertext2HandlesValidityProofData,
4242
pub range_proof_data: BatchedRangeProofU256Data,
@@ -152,7 +152,7 @@ pub fn transfer_with_fee_split_proof_data(
152152
.map_err(|_| TokenProofGenerationError::CiphertextExtraction)?;
153153

154154
let transfer_amount_ciphertext_validity_proof_data_with_ciphertext =
155-
CiphertextValidityProofWithCiphertext {
155+
CiphertextValidityProofWithAuditorCiphertext {
156156
proof_data: transfer_amount_ciphertext_validity_proof_data,
157157
ciphertext_lo: transfer_amount_auditor_ciphertext_lo,
158158
ciphertext_hi: transfer_amount_auditor_ciphertext_hi,

0 commit comments

Comments
 (0)