File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -90,15 +90,6 @@ impl<const LIMBS: usize> Uint<LIMBS> {
9090        Self :: select ( & res,  & Self :: MAX ,  overflow. is_nonzero ( ) ) 
9191    } 
9292
93-     /// Square self, returning a concatenated "wide" result. 
94- pub  const  fn  square < const  WIDE_LIMBS :  usize > ( & self )  -> Uint < WIDE_LIMBS > 
95-     where 
96-         Self :  Concat < Output  = Uint < WIDE_LIMBS > > , 
97-     { 
98-         let  ( lo,  hi)  = self . square_wide ( ) ; 
99-         concat_mixed ( & lo,  & hi) 
100-     } 
101- 
10293    /// Square self, returning a "wide" result in two parts as (lo, hi). 
10394pub  const  fn  square_wide ( & self )  -> ( Self ,  Self )  { 
10495        // Translated from https://github.com/ucbrise/jedi-pairing/blob/c4bf151/include/core/bigint.hpp#L410 
@@ -174,6 +165,17 @@ impl<const LIMBS: usize> Uint<LIMBS> {
174165    } 
175166} 
176167
168+ impl < const  LIMBS :  usize ,  const  WIDE_LIMBS :  usize >  Uint < LIMBS > 
169+ where 
170+     Self :  Concat < Output  = Uint < WIDE_LIMBS > > , 
171+ { 
172+     /// Square self, returning a concatenated "wide" result. 
173+ pub  const  fn  square ( & self )  -> Uint < WIDE_LIMBS >  { 
174+         let  ( lo,  hi)  = self . square_wide ( ) ; 
175+         concat_mixed ( & lo,  & hi) 
176+     } 
177+ } 
178+ 
177179impl < const  LIMBS :  usize ,  const  RHS_LIMBS :  usize >  CheckedMul < Uint < RHS_LIMBS > >  for  Uint < LIMBS >  { 
178180    #[ inline]  
179181    fn  checked_mul ( & self ,  rhs :  & Uint < RHS_LIMBS > )  -> CtOption < Self >  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments