@@ -57,19 +57,19 @@ use {
57
57
transfer_hook:: TransferHook ,
58
58
BaseStateWithExtensions , ExtensionType , StateWithExtensionsOwned ,
59
59
} ,
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 ,
67
64
} ,
68
65
state:: { Account , AccountState , Mint } ,
69
66
} ,
70
67
spl_token_client:: {
71
68
client:: { ProgramRpcClientSendTransaction , RpcClientResponse } ,
72
- token:: { ComputeUnitLimit , ExtensionInitializationParams , ProofAccount , Token } ,
69
+ token:: {
70
+ ComputeUnitLimit , ExtensionInitializationParams , ProofAccount ,
71
+ ProofAccountWithCiphertext , Token ,
72
+ } ,
73
73
} ,
74
74
spl_token_confidential_transfer_proof_generation:: {
75
75
transfer:: TransferProofData , withdraw:: WithdrawProofData ,
@@ -1614,7 +1614,7 @@ async fn command_transfer(
1614
1614
1615
1615
let TransferProofData {
1616
1616
equality_proof_data,
1617
- ciphertext_validity_proof_data ,
1617
+ ciphertext_validity_proof_data_with_ciphertext ,
1618
1618
range_proof_data,
1619
1619
} = transfer_account_info
1620
1620
. generate_split_transfer_proof_data (
@@ -1626,16 +1626,10 @@ async fn command_transfer(
1626
1626
)
1627
1627
. unwrap ( ) ;
1628
1628
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 ;
1639
1633
1640
1634
// setup proofs
1641
1635
let create_range_proof_context_signer = & [ & range_proof_context_state_account] ;
@@ -1661,7 +1655,7 @@ async fn command_transfer(
1661
1655
token. confidential_transfer_create_context_state_account(
1662
1656
& ciphertext_validity_proof_pubkey,
1663
1657
& context_state_authority_pubkey,
1664
- & ciphertext_validity_proof_data ,
1658
+ & ciphertext_validity_proof_data_with_ciphertext . proof_data ,
1665
1659
false ,
1666
1660
create_ciphertext_validity_proof_context_signer
1667
1661
)
@@ -1675,17 +1669,21 @@ async fn command_transfer(
1675
1669
let range_proof_context_proof_account =
1676
1670
ProofAccount :: ContextAccount ( range_proof_pubkey) ;
1677
1671
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
+
1678
1678
let transfer_result = token
1679
1679
. confidential_transfer_transfer (
1680
1680
& sender,
1681
1681
& recipient_token_account,
1682
1682
& sender_owner,
1683
1683
Some ( & equality_proof_context_proof_account) ,
1684
- Some ( & ciphertext_validity_proof_context_proof_account ) ,
1684
+ Some ( & ciphertext_validity_proof_account_with_ciphertext ) ,
1685
1685
Some ( & range_proof_context_proof_account) ,
1686
1686
transfer_balance,
1687
- Some ( & transfer_amount_auditor_ciphertext_lo) ,
1688
- Some ( & transfer_amount_auditor_ciphertext_hi) ,
1689
1687
Some ( transfer_account_info) ,
1690
1688
& args. sender_elgamal_keypair ,
1691
1689
& args. sender_aes_key ,
0 commit comments