mirror of https://github.com/zcash/orchard.git
commit
15007026b1
|
@ -583,9 +583,7 @@ impl<P: fmt::Debug, V> Bundle<InProgress<P, PartiallyAuthorized>, V> {
|
||||||
self,
|
self,
|
||||||
signatures: &[redpallas::Signature<SpendAuth>],
|
signatures: &[redpallas::Signature<SpendAuth>],
|
||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
signatures
|
signatures.iter().try_fold(self, Self::append_signature)
|
||||||
.into_iter()
|
|
||||||
.try_fold(self, Self::append_signature)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn append_signature(self, signature: &redpallas::Signature<SpendAuth>) -> Result<Self, Error> {
|
fn append_signature(self, signature: &redpallas::Signature<SpendAuth>) -> Result<Self, Error> {
|
||||||
|
|
|
@ -88,8 +88,8 @@ pub(in crate::circuit) trait AddInstruction<F: FieldExt>: Chip<F> {
|
||||||
/// Witnesses the given value in a standalone region.
|
/// Witnesses the given value in a standalone region.
|
||||||
///
|
///
|
||||||
/// Usages of this helper are technically superfluous, as the single-cell region is only
|
/// Usages of this helper are technically superfluous, as the single-cell region is only
|
||||||
/// ever used in equality constraints. We could eliminate them with a write-on-copy
|
/// ever used in equality constraints. We could eliminate them with a
|
||||||
/// abstraction (https://github.com/zcash/halo2/issues/334).
|
/// [write-on-copy abstraction](https://github.com/zcash/halo2/issues/334).
|
||||||
pub(in crate::circuit) fn assign_free_advice<F: Field, V: Copy>(
|
pub(in crate::circuit) fn assign_free_advice<F: Field, V: Copy>(
|
||||||
mut layouter: impl Layouter<F>,
|
mut layouter: impl Layouter<F>,
|
||||||
column: Column<Advice>,
|
column: Column<Advice>,
|
||||||
|
|
|
@ -8,10 +8,10 @@ pub fn gen_const_array<Output: Copy + Default, const LEN: usize>(
|
||||||
|
|
||||||
pub(crate) fn gen_const_array_with_default<Output: Copy, const LEN: usize>(
|
pub(crate) fn gen_const_array_with_default<Output: Copy, const LEN: usize>(
|
||||||
default_value: Output,
|
default_value: Output,
|
||||||
mut closure: impl FnMut(usize) -> Output,
|
closure: impl FnMut(usize) -> Output,
|
||||||
) -> [Output; LEN] {
|
) -> [Output; LEN] {
|
||||||
let mut ret: [Output; LEN] = [default_value; LEN];
|
let mut ret: [Output; LEN] = [default_value; LEN];
|
||||||
for (bit, val) in ret.iter_mut().zip((0..LEN).map(|idx| closure(idx))) {
|
for (bit, val) in ret.iter_mut().zip((0..LEN).map(closure)) {
|
||||||
*bit = val;
|
*bit = val;
|
||||||
}
|
}
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -739,7 +739,7 @@ impl AsRef<[u8; 32]> for OutgoingViewingKey {
|
||||||
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
||||||
///
|
///
|
||||||
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||||
pub struct DiversifiedTransmissionKey(NonIdentityPallasPoint);
|
pub struct DiversifiedTransmissionKey(NonIdentityPallasPoint);
|
||||||
|
|
||||||
impl DiversifiedTransmissionKey {
|
impl DiversifiedTransmissionKey {
|
||||||
|
@ -772,13 +772,6 @@ impl DiversifiedTransmissionKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Required for CtOption operations.
|
|
||||||
impl Default for DiversifiedTransmissionKey {
|
|
||||||
fn default() -> Self {
|
|
||||||
DiversifiedTransmissionKey(NonIdentityPallasPoint::default())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ConditionallySelectable for DiversifiedTransmissionKey {
|
impl ConditionallySelectable for DiversifiedTransmissionKey {
|
||||||
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {
|
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {
|
||||||
DiversifiedTransmissionKey(NonIdentityPallasPoint::conditional_select(
|
DiversifiedTransmissionKey(NonIdentityPallasPoint::conditional_select(
|
||||||
|
|
Loading…
Reference in New Issue