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

Commit 19b7525

Browse files
committed
change order of ElGamalKeypair and AeKey parameters for consistency
1 parent 9c80b2c commit 19b7525

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

token/program-2022/src/extension/confidential_mint_burn/account_info.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl SupplyAccountInfo {
5252
/// Computes the current supply from the decryptable supply and the
5353
/// difference between the decryptable supply and the ElGamal encrypted
5454
/// supply ciphertext
55-
pub fn decrypt_current_supply(
55+
pub fn decrypted_current_supply(
5656
&self,
5757
aes_key: &AeKey,
5858
elgamal_keypair: &ElGamalKeypair,
@@ -86,12 +86,12 @@ impl SupplyAccountInfo {
8686
/// `RotateSupplyElgamalPubkey` instruction
8787
pub fn generate_rotate_supply_elgamal_pubkey_proof(
8888
&self,
89-
aes_key: &AeKey,
9089
current_supply_elgamal_keypair: &ElGamalKeypair,
9190
new_supply_elgamal_keypair: &ElGamalKeypair,
91+
aes_key: &AeKey,
9292
) -> Result<CiphertextCiphertextEqualityProofData, TokenError> {
9393
let current_supply =
94-
self.decrypt_current_supply(aes_key, current_supply_elgamal_keypair)?;
94+
self.decrypted_current_supply(aes_key, current_supply_elgamal_keypair)?;
9595

9696
let new_supply_opening = PedersenOpening::new_rand();
9797
let new_supply_ciphertext = new_supply_elgamal_keypair
@@ -142,10 +142,10 @@ impl SupplyAccountInfo {
142142
pub fn new_decryptable_supply(
143143
&self,
144144
mint_amount: u64,
145-
aes_key: &AeKey,
146145
elgamal_keypair: &ElGamalKeypair,
146+
aes_key: &AeKey,
147147
) -> Result<AeCiphertext, TokenError> {
148-
let current_decrypted_supply = self.decrypt_current_supply(aes_key, elgamal_keypair)?;
148+
let current_decrypted_supply = self.decrypted_current_supply(aes_key, elgamal_keypair)?;
149149
let new_decrypted_available_balance = current_decrypted_supply
150150
.checked_add(mint_amount)
151151
.ok_or(TokenError::Overflow)?;

0 commit comments

Comments
 (0)