@@ -158,6 +158,14 @@ pub trait Integer:
158158    /// The value `1`. 
159159fn  one ( )  -> Self ; 
160160
161+     /// The value `1` with the same precision as `other`. 
162+ fn  one_like ( other :  & Self )  -> Self  { 
163+         Self :: from_limb_like ( Limb :: ONE ,  other) 
164+     } 
165+ 
166+     /// Returns an integer with the first limb set to `limb`, and the same precision as `other`. 
167+ fn  from_limb_like ( limb :  Limb ,  other :  & Self )  -> Self ; 
168+ 
161169    /// Number of limbs in this integer. 
162170fn  nlimbs ( & self )  -> usize ; 
163171
@@ -244,6 +252,16 @@ pub trait Zero: ConstantTimeEq + Sized {
244252    fn  set_zero ( & mut  self )  { 
245253        * self  = Zero :: zero ( ) ; 
246254    } 
255+ 
256+     /// Return the value `0` with the same precision as `other`. 
257+ fn  zero_like ( other :  & Self )  -> Self 
258+     where 
259+         Self :  Clone , 
260+     { 
261+         let  mut  ret = other. clone ( ) ; 
262+         ret. set_zero ( ) ; 
263+         ret
264+     } 
247265} 
248266
249267/// Trait for associating a constant representing zero. 
@@ -787,6 +805,12 @@ pub trait Monty:
787805    /// Returns one in this representation. 
788806fn  one ( params :  Self :: Params )  -> Self ; 
789807
808+     /// Returns the parameter struct used to initialize this object. 
809+ fn  params ( & self )  -> & Self :: Params ; 
810+ 
811+     /// Access the value in Montgomery form. 
812+ fn  as_montgomery ( & self )  -> & Self :: Integer ; 
813+ 
790814    /// Performs division by 2, that is returns `x` such that `x + x = self`. 
791815fn  div_by_2 ( & self )  -> Self ; 
792816} 
0 commit comments