Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/modular/boxed_monty_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use super::{
BoxedMontyParams, Retrieve, div_by_2, monty_params::MontyParams,
reduction::montgomery_retrieve_inner,
};
use crate::{BoxedUint, Choice, MontyForm, Odd};
use crate::{BoxedUint, Choice, MontyForm, Odd, sealed::Sealed};
use mul::BoxedMontyMultiplier;

#[cfg(feature = "zeroize")]
Expand Down Expand Up @@ -224,6 +224,8 @@ impl MontyForm for BoxedMontyForm {
}
}

impl Sealed for BoxedMontyForm {}

/// NOTE: This zeroizes the value, but _not_ the associated parameters!
#[cfg(feature = "zeroize")]
impl Zeroize for BoxedMontyForm {
Expand Down
4 changes: 3 additions & 1 deletion src/modular/fixed_monty_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::{
mul::mul_montgomery_form,
reduction::montgomery_retrieve,
};
use crate::{MontyForm, Odd, Uint};
use crate::{MontyForm, Odd, Uint, sealed::Sealed};
use mul::FixedMontyMultiplier;

/// An integer in Montgomery form represented using `LIMBS` limbs.
Expand Down Expand Up @@ -172,6 +172,8 @@ impl<const LIMBS: usize> MontyForm for FixedMontyForm<LIMBS> {
}
}

impl<const LIMBS: usize> Sealed for FixedMontyForm<LIMBS> {}

impl<const LIMBS: usize, P: ConstMontyParams<LIMBS>> From<&ConstMontyForm<P, LIMBS>>
for FixedMontyForm<LIMBS>
{
Expand Down
1 change: 1 addition & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ pub trait Resize: Sized {
/// A representation of an integer optimized for the performance of modular operations.
pub trait MontyForm:
'static
+ sealed::Sealed
+ Clone
+ CtEq
+ CtSelect
Expand Down
Loading