mirror of https://github.com/zcash/orchard.git
Merge pull request #419 from nuttycom/nullifier_ct_eq
Additions needed for Orchard batch scanning
This commit is contained in:
commit
2a312c0cf1
|
@ -7,6 +7,11 @@ and this project adheres to Rust's notion of
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `impl subtle::ConstantTimeEq for note::Nullifier`
|
||||||
|
- `impl Clone for note_encryption::CompactAction`
|
||||||
|
- `note_encryption::CompactAction::cmx`
|
||||||
|
|
||||||
## [0.7.0] - 2024-01-26
|
## [0.7.0] - 2024-01-26
|
||||||
### Licensing
|
### Licensing
|
||||||
- The license for this crate is now "MIT OR Apache-2.0". The license
|
- The license for this crate is now "MIT OR Apache-2.0". The license
|
||||||
|
|
|
@ -3,7 +3,7 @@ use halo2_proofs::arithmetic::CurveExt;
|
||||||
use memuse::DynamicUsage;
|
use memuse::DynamicUsage;
|
||||||
use pasta_curves::pallas;
|
use pasta_curves::pallas;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
use subtle::CtOption;
|
use subtle::{ConstantTimeEq, CtOption};
|
||||||
|
|
||||||
use super::NoteCommitment;
|
use super::NoteCommitment;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -62,6 +62,12 @@ impl Nullifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ConstantTimeEq for Nullifier {
|
||||||
|
fn ct_eq(&self, other: &Self) -> subtle::Choice {
|
||||||
|
self.0.ct_eq(&other.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Generators for property testing.
|
/// Generators for property testing.
|
||||||
#[cfg(any(test, feature = "test-dependencies"))]
|
#[cfg(any(test, feature = "test-dependencies"))]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "test-dependencies")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "test-dependencies")))]
|
||||||
|
|
|
@ -269,6 +269,7 @@ impl<T> ShieldedOutput<OrchardDomain, ENC_CIPHERTEXT_SIZE> for Action<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A compact Action for light clients.
|
/// A compact Action for light clients.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct CompactAction {
|
pub struct CompactAction {
|
||||||
nullifier: Nullifier,
|
nullifier: Nullifier,
|
||||||
cmx: ExtractedNoteCommitment,
|
cmx: ExtractedNoteCommitment,
|
||||||
|
@ -325,10 +326,15 @@ impl CompactAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///Returns the nullifier of the note being spent.
|
/// Returns the nullifier of the note being spent.
|
||||||
pub fn nullifier(&self) -> Nullifier {
|
pub fn nullifier(&self) -> Nullifier {
|
||||||
self.nullifier
|
self.nullifier
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the commitment to the new note being created.
|
||||||
|
pub fn cmx(&self) -> ExtractedNoteCommitment {
|
||||||
|
self.cmx
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in New Issue