remove aes ciphertext from the proof program
This commit is contained in:
@ -6,7 +6,6 @@ use {
|
|||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
encryption::{
|
encryption::{
|
||||||
aes::AESCiphertext,
|
|
||||||
elgamal::{ElGamalCiphertext, ElGamalPubkey, ElGamalSecretKey},
|
elgamal::{ElGamalCiphertext, ElGamalPubkey, ElGamalSecretKey},
|
||||||
pedersen::{
|
pedersen::{
|
||||||
Pedersen, PedersenBase, PedersenCommitment, PedersenDecryptHandle, PedersenOpening,
|
Pedersen, PedersenBase, PedersenCommitment, PedersenDecryptHandle, PedersenOpening,
|
||||||
@ -47,9 +46,6 @@ pub struct TransferData {
|
|||||||
|
|
||||||
/// Zero-knowledge proofs for Transfer
|
/// Zero-knowledge proofs for Transfer
|
||||||
pub proof: TransferProof,
|
pub proof: TransferProof,
|
||||||
|
|
||||||
/// The new decryptable balance
|
|
||||||
pub aes_ciphertext: pod::OptionAESCiphertext, // 17 bytes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "bpf"))]
|
#[cfg(not(target_arch = "bpf"))]
|
||||||
@ -63,7 +59,6 @@ impl TransferData {
|
|||||||
source_sk: &ElGamalSecretKey,
|
source_sk: &ElGamalSecretKey,
|
||||||
dest_pk: ElGamalPubkey,
|
dest_pk: ElGamalPubkey,
|
||||||
auditor_pk: ElGamalPubkey,
|
auditor_pk: ElGamalPubkey,
|
||||||
aes_ciphertext: Option<AESCiphertext>,
|
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// split and encrypt transfer amount
|
// split and encrypt transfer amount
|
||||||
//
|
//
|
||||||
@ -142,7 +137,6 @@ impl TransferData {
|
|||||||
new_spendable_ct: new_spendable_ct.into(),
|
new_spendable_ct: new_spendable_ct.into(),
|
||||||
transfer_public_keys,
|
transfer_public_keys,
|
||||||
proof,
|
proof,
|
||||||
aes_ciphertext: aes_ciphertext.into(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,7 +494,6 @@ mod test {
|
|||||||
&source_sk,
|
&source_sk,
|
||||||
dest_pk,
|
dest_pk,
|
||||||
auditor_pk,
|
auditor_pk,
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
assert!(transfer_data.verify().is_ok());
|
assert!(transfer_data.verify().is_ok());
|
||||||
@ -535,7 +528,6 @@ mod test {
|
|||||||
&source_sk,
|
&source_sk,
|
||||||
dest_pk,
|
dest_pk,
|
||||||
auditor_pk,
|
auditor_pk,
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let decryption_data = decode_u32_precomputation_for_G();
|
let decryption_data = decode_u32_precomputation_for_G();
|
||||||
|
@ -8,7 +8,6 @@ use {
|
|||||||
encryption::{
|
encryption::{
|
||||||
elgamal::{ElGamalCiphertext, ElGamalPubkey, ElGamalSecretKey},
|
elgamal::{ElGamalCiphertext, ElGamalPubkey, ElGamalSecretKey},
|
||||||
pedersen::{PedersenBase, PedersenOpening},
|
pedersen::{PedersenBase, PedersenOpening},
|
||||||
aes::AESCiphertext,
|
|
||||||
},
|
},
|
||||||
errors::ProofError,
|
errors::ProofError,
|
||||||
instruction::Verifiable,
|
instruction::Verifiable,
|
||||||
@ -37,9 +36,6 @@ pub struct WithdrawData {
|
|||||||
|
|
||||||
/// Proof that the account is solvent
|
/// Proof that the account is solvent
|
||||||
pub proof: WithdrawProof, // 736 bytes
|
pub proof: WithdrawProof, // 736 bytes
|
||||||
|
|
||||||
/// The new decryptable balance component
|
|
||||||
pub aes_ciphertext: pod::OptionAESCiphertext, // 17 bytes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WithdrawData {
|
impl WithdrawData {
|
||||||
@ -50,7 +46,6 @@ impl WithdrawData {
|
|||||||
source_sk: &ElGamalSecretKey,
|
source_sk: &ElGamalSecretKey,
|
||||||
current_balance: u64,
|
current_balance: u64,
|
||||||
current_balance_ct: ElGamalCiphertext,
|
current_balance_ct: ElGamalCiphertext,
|
||||||
aes_ciphertext: Option<AESCiphertext>,
|
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// subtract withdraw amount from current balance
|
// subtract withdraw amount from current balance
|
||||||
//
|
//
|
||||||
@ -67,7 +62,6 @@ impl WithdrawData {
|
|||||||
Self {
|
Self {
|
||||||
final_balance_ct: final_balance_ct.into(),
|
final_balance_ct: final_balance_ct.into(),
|
||||||
proof,
|
proof,
|
||||||
aes_ciphertext: aes_ciphertext.into(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,7 +192,6 @@ mod test {
|
|||||||
&secret,
|
&secret,
|
||||||
current_balance,
|
current_balance,
|
||||||
current_balance_ct,
|
current_balance_ct,
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
assert!(data.verify().is_ok());
|
assert!(data.verify().is_ok());
|
||||||
|
|
||||||
@ -210,7 +203,6 @@ mod test {
|
|||||||
&secret,
|
&secret,
|
||||||
wrong_balance,
|
wrong_balance,
|
||||||
current_balance_ct,
|
current_balance_ct,
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
assert!(data.verify().is_err());
|
assert!(data.verify().is_err());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user