Rename ElGamalPubkey::gen_decrypt_handle method to ElGamalPubkey::decrypt_handle
This commit is contained in:
		| @@ -56,7 +56,7 @@ impl ElGamal { | ||||
|     #[cfg(not(target_arch = "bpf"))] | ||||
|     pub fn encrypt<T: Into<Scalar>>(pk: &ElGamalPubkey, amount: T) -> ElGamalCiphertext { | ||||
|         let (message_comm, open) = Pedersen::new(amount); | ||||
|         let decrypt_handle = pk.gen_decrypt_handle(&open); | ||||
|         let decrypt_handle = pk.decrypt_handle(&open); | ||||
|  | ||||
|         ElGamalCiphertext { | ||||
|             message_comm, | ||||
| @@ -73,7 +73,7 @@ impl ElGamal { | ||||
|         open: &PedersenOpening, | ||||
|     ) -> ElGamalCiphertext { | ||||
|         let message_comm = Pedersen::with(amount, open); | ||||
|         let decrypt_handle = pk.gen_decrypt_handle(open); | ||||
|         let decrypt_handle = pk.decrypt_handle(open); | ||||
|  | ||||
|         ElGamalCiphertext { | ||||
|             message_comm, | ||||
| @@ -153,7 +153,7 @@ impl ElGamalPubkey { | ||||
|  | ||||
|     /// Generate a decryption token from an ElGamal public key and a Pedersen | ||||
|     /// opening. | ||||
|     pub fn gen_decrypt_handle(self, open: &PedersenOpening) -> PedersenDecryptHandle { | ||||
|     pub fn decrypt_handle(self, open: &PedersenOpening) -> PedersenDecryptHandle { | ||||
|         PedersenDecryptHandle::new(&self, open) | ||||
|     } | ||||
| } | ||||
| @@ -395,8 +395,8 @@ mod tests { | ||||
|         let msg: u32 = 77; | ||||
|         let (comm, open) = Pedersen::new(msg); | ||||
|  | ||||
|         let decrypt_handle_1 = pk_1.gen_decrypt_handle(&open); | ||||
|         let decrypt_handle_2 = pk_2.gen_decrypt_handle(&open); | ||||
|         let decrypt_handle_1 = pk_1.decrypt_handle(&open); | ||||
|         let decrypt_handle_2 = pk_2.decrypt_handle(&open); | ||||
|  | ||||
|         let ct_1: ElGamalCiphertext = (comm, decrypt_handle_1).into(); | ||||
|         let ct_2: ElGamalCiphertext = (comm, decrypt_handle_2).into(); | ||||
|   | ||||
| @@ -56,13 +56,13 @@ impl TransferData { | ||||
|         let (comm_lo, open_lo) = Pedersen::new(amount_lo); | ||||
|         let (comm_hi, open_hi) = Pedersen::new(amount_hi); | ||||
|  | ||||
|         let handle_source_lo = source_pk.gen_decrypt_handle(&open_lo); | ||||
|         let handle_dest_lo = dest_pk.gen_decrypt_handle(&open_lo); | ||||
|         let handle_auditor_lo = auditor_pk.gen_decrypt_handle(&open_lo); | ||||
|         let handle_source_lo = source_pk.decrypt_handle(&open_lo); | ||||
|         let handle_dest_lo = dest_pk.decrypt_handle(&open_lo); | ||||
|         let handle_auditor_lo = auditor_pk.decrypt_handle(&open_lo); | ||||
|  | ||||
|         let handle_source_hi = source_pk.gen_decrypt_handle(&open_hi); | ||||
|         let handle_dest_hi = dest_pk.gen_decrypt_handle(&open_hi); | ||||
|         let handle_auditor_hi = auditor_pk.gen_decrypt_handle(&open_hi); | ||||
|         let handle_source_hi = source_pk.decrypt_handle(&open_hi); | ||||
|         let handle_dest_hi = dest_pk.decrypt_handle(&open_hi); | ||||
|         let handle_auditor_hi = auditor_pk.decrypt_handle(&open_hi); | ||||
|  | ||||
|         // message encoding as Pedersen commitments, which will be included in range proof data | ||||
|         let amount_comms = TransferComms { | ||||
|   | ||||
| @@ -325,18 +325,16 @@ mod tests { | ||||
|  | ||||
|         // decryption handles associated with TransferValidityProof | ||||
|         let handle_source_lo: pod::PedersenDecryptHandle = | ||||
|             source_pk.gen_decrypt_handle(&open_lo).into(); | ||||
|         let handle_dest_lo: pod::PedersenDecryptHandle = | ||||
|             dest_pk.gen_decrypt_handle(&open_lo).into(); | ||||
|             source_pk.decrypt_handle(&open_lo).into(); | ||||
|         let handle_dest_lo: pod::PedersenDecryptHandle = dest_pk.decrypt_handle(&open_lo).into(); | ||||
|         let _handle_auditor_lo: pod::PedersenDecryptHandle = | ||||
|             auditor_pk.gen_decrypt_handle(&open_lo).into(); | ||||
|             auditor_pk.decrypt_handle(&open_lo).into(); | ||||
|  | ||||
|         let handle_source_hi: pod::PedersenDecryptHandle = | ||||
|             source_pk.gen_decrypt_handle(&open_hi).into(); | ||||
|         let handle_dest_hi: pod::PedersenDecryptHandle = | ||||
|             dest_pk.gen_decrypt_handle(&open_hi).into(); | ||||
|             source_pk.decrypt_handle(&open_hi).into(); | ||||
|         let handle_dest_hi: pod::PedersenDecryptHandle = dest_pk.decrypt_handle(&open_hi).into(); | ||||
|         let _handle_auditor_hi: pod::PedersenDecryptHandle = | ||||
|             auditor_pk.gen_decrypt_handle(&open_hi).into(); | ||||
|             auditor_pk.decrypt_handle(&open_hi).into(); | ||||
|  | ||||
|         // source spendable and recipient pending | ||||
|         let source_open = PedersenOpening::random(&mut OsRng); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user