@@ -57,19 +57,19 @@ use {
5757 transfer_hook:: TransferHook ,
5858 BaseStateWithExtensions , ExtensionType , StateWithExtensionsOwned ,
5959 } ,
60- solana_zk_sdk:: {
61- encryption:: {
62- auth_encryption:: AeKey ,
63- elgamal:: { self , ElGamalKeypair } ,
64- pod:: elgamal:: PodElGamalPubkey ,
65- } ,
66- zk_elgamal_proof_program:: proof_data:: ZkProofData ,
60+ solana_zk_sdk:: encryption:: {
61+ auth_encryption:: AeKey ,
62+ elgamal:: { self , ElGamalKeypair } ,
63+ pod:: elgamal:: PodElGamalPubkey ,
6764 } ,
6865 state:: { Account , AccountState , Mint } ,
6966 } ,
7067 spl_token_client:: {
7168 client:: { ProgramRpcClientSendTransaction , RpcClientResponse } ,
72- token:: { ComputeUnitLimit , ExtensionInitializationParams , ProofAccount , Token } ,
69+ token:: {
70+ ComputeUnitLimit , ExtensionInitializationParams , ProofAccount ,
71+ ProofAccountWithCiphertext , Token ,
72+ } ,
7373 } ,
7474 spl_token_confidential_transfer_proof_generation:: {
7575 transfer:: TransferProofData , withdraw:: WithdrawProofData ,
@@ -1614,7 +1614,7 @@ async fn command_transfer(
16141614
16151615 let TransferProofData {
16161616 equality_proof_data,
1617- ciphertext_validity_proof_data ,
1617+ ciphertext_validity_proof_data_with_ciphertext ,
16181618 range_proof_data,
16191619 } = transfer_account_info
16201620 . generate_split_transfer_proof_data (
@@ -1626,16 +1626,10 @@ async fn command_transfer(
16261626 )
16271627 . unwrap ( ) ;
16281628
1629- let transfer_amount_auditor_ciphertext_lo = ciphertext_validity_proof_data
1630- . context_data ( )
1631- . grouped_ciphertext_lo
1632- . try_extract_ciphertext ( 2 )
1633- . unwrap ( ) ;
1634- let transfer_amount_auditor_ciphertext_hi = ciphertext_validity_proof_data
1635- . context_data ( )
1636- . grouped_ciphertext_hi
1637- . try_extract_ciphertext ( 2 )
1638- . unwrap ( ) ;
1629+ let transfer_amount_auditor_ciphertext_lo =
1630+ ciphertext_validity_proof_data_with_ciphertext. ciphertext_lo ;
1631+ let transfer_amount_auditor_ciphertext_hi =
1632+ ciphertext_validity_proof_data_with_ciphertext. ciphertext_hi ;
16391633
16401634 // setup proofs
16411635 let create_range_proof_context_signer = & [ & range_proof_context_state_account] ;
@@ -1661,7 +1655,7 @@ async fn command_transfer(
16611655 token. confidential_transfer_create_context_state_account(
16621656 & ciphertext_validity_proof_pubkey,
16631657 & context_state_authority_pubkey,
1664- & ciphertext_validity_proof_data ,
1658+ & ciphertext_validity_proof_data_with_ciphertext . proof_data ,
16651659 false ,
16661660 create_ciphertext_validity_proof_context_signer
16671661 )
@@ -1675,17 +1669,21 @@ async fn command_transfer(
16751669 let range_proof_context_proof_account =
16761670 ProofAccount :: ContextAccount ( range_proof_pubkey) ;
16771671
1672+ let ciphertext_validity_proof_account_with_ciphertext = ProofAccountWithCiphertext {
1673+ proof_account : ciphertext_validity_proof_context_proof_account,
1674+ ciphertext_lo : transfer_amount_auditor_ciphertext_lo,
1675+ ciphertext_hi : transfer_amount_auditor_ciphertext_hi,
1676+ } ;
1677+
16781678 let transfer_result = token
16791679 . confidential_transfer_transfer (
16801680 & sender,
16811681 & recipient_token_account,
16821682 & sender_owner,
16831683 Some ( & equality_proof_context_proof_account) ,
1684- Some ( & ciphertext_validity_proof_context_proof_account ) ,
1684+ Some ( & ciphertext_validity_proof_account_with_ciphertext ) ,
16851685 Some ( & range_proof_context_proof_account) ,
16861686 transfer_balance,
1687- Some ( & transfer_amount_auditor_ciphertext_lo) ,
1688- Some ( & transfer_amount_auditor_ciphertext_hi) ,
16891687 Some ( transfer_account_info) ,
16901688 & args. sender_elgamal_keypair ,
16911689 & args. sender_aes_key ,
0 commit comments