@@ -8,7 +8,7 @@ use core::{
88} ;
99
1010use subtle:: { Choice , ConditionallySelectable , ConstantTimeEq , CtOption } ;
11- use typenum:: { B1 , U0 , U256 , Unsigned , type_operators:: IsLessOrEqual } ;
11+ use typenum:: { B1 , U1 , U256 , Unsigned , type_operators:: IsLessOrEqual } ;
1212
1313use rand_core:: { RngCore , TryRngCore } ;
1414
@@ -36,13 +36,13 @@ impl<U: Unsigned, F: Field> Debug for EagerField<U, F> {
3636 }
3737}
3838
39- impl < F : Field > EagerField < U0 , F > {
39+ impl < F : Field > EagerField < U1 , F > {
4040 const fn from ( field : F ) -> Self {
4141 Self ( field, PhantomData )
4242 }
4343}
4444
45- impl < F : Field > ConditionallySelectable for EagerField < U0 , F > {
45+ impl < F : Field > ConditionallySelectable for EagerField < U1 , F > {
4646 fn conditional_select ( a : & Self , b : & Self , choice : Choice ) -> Self {
4747 Self :: from ( <_ >:: conditional_select ( & a. 0 , & b. 0 , choice) )
4848 }
@@ -58,99 +58,99 @@ impl<U: Unsigned, F: Field> PartialEq for EagerField<U, F> {
5858 }
5959}
6060impl < U : Unsigned , F : Field > Eq for EagerField < U , F > { }
61- impl < F : Field > Neg for EagerField < U0 , F > {
61+ impl < F : Field > Neg for EagerField < U1 , F > {
6262 type Output = Self ;
6363 fn neg ( self ) -> Self {
6464 Self :: from ( self . 0 . neg ( ) )
6565 }
6666}
67- impl < F : Field > Add for EagerField < U0 , F > {
67+ impl < F : Field > Add for EagerField < U1 , F > {
6868 type Output = Self ;
6969 fn add ( self , other : Self ) -> Self {
7070 Self :: from ( self . 0 . add ( other. 0 ) )
7171 }
7272}
73- impl < F : Field > Sub for EagerField < U0 , F > {
73+ impl < F : Field > Sub for EagerField < U1 , F > {
7474 type Output = Self ;
7575 fn sub ( self , other : Self ) -> Self {
7676 Self :: from ( self . 0 . sub ( other. 0 ) )
7777 }
7878}
79- impl < F : Field > Mul for EagerField < U0 , F > {
79+ impl < F : Field > Mul for EagerField < U1 , F > {
8080 type Output = Self ;
8181 fn mul ( self , other : Self ) -> Self {
8282 Self :: from ( self . 0 . mul ( other. 0 ) )
8383 }
8484}
85- impl < F : Field > Sum for EagerField < U0 , F > {
85+ impl < F : Field > Sum for EagerField < U1 , F > {
8686 fn sum < I : Iterator < Item = Self > > ( iter : I ) -> Self {
8787 Self :: from ( F :: sum ( iter. map ( |item| item. 0 ) ) )
8888 }
8989}
90- impl < F : Field > Product for EagerField < U0 , F > {
90+ impl < F : Field > Product for EagerField < U1 , F > {
9191 fn product < I : Iterator < Item = Self > > ( iter : I ) -> Self {
9292 Self :: from ( F :: product ( iter. map ( |item| item. 0 ) ) )
9393 }
9494}
95- impl < ' a , F : Field > Add < & ' a Self > for EagerField < U0 , F > {
95+ impl < ' a , F : Field > Add < & ' a Self > for EagerField < U1 , F > {
9696 type Output = Self ;
9797 fn add ( self , other : & ' a Self ) -> Self {
9898 Self :: from ( self . 0 . add ( & other. 0 ) )
9999 }
100100}
101- impl < ' a , F : Field > Sub < & ' a Self > for EagerField < U0 , F > {
101+ impl < ' a , F : Field > Sub < & ' a Self > for EagerField < U1 , F > {
102102 type Output = Self ;
103103 fn sub ( self , other : & ' a Self ) -> Self {
104104 Self :: from ( self . 0 . sub ( & other. 0 ) )
105105 }
106106}
107- impl < ' a , F : Field > Mul < & ' a Self > for EagerField < U0 , F > {
107+ impl < ' a , F : Field > Mul < & ' a Self > for EagerField < U1 , F > {
108108 type Output = Self ;
109109 fn mul ( self , other : & ' a Self ) -> Self {
110110 Self :: from ( self . 0 . mul ( & other. 0 ) )
111111 }
112112}
113- impl < ' a , F : Field > Sum < & ' a Self > for EagerField < U0 , F > {
113+ impl < ' a , F : Field > Sum < & ' a Self > for EagerField < U1 , F > {
114114 fn sum < I : Iterator < Item = & ' a Self > > ( iter : I ) -> Self {
115115 Self :: from ( F :: sum ( iter. map ( |item| & item. 0 ) ) )
116116 }
117117}
118- impl < ' a , F : Field > Product < & ' a Self > for EagerField < U0 , F > {
118+ impl < ' a , F : Field > Product < & ' a Self > for EagerField < U1 , F > {
119119 fn product < I : Iterator < Item = & ' a Self > > ( iter : I ) -> Self {
120120 Self :: from ( F :: product ( iter. map ( |item| & item. 0 ) ) )
121121 }
122122}
123- impl < F : Field > AddAssign for EagerField < U0 , F > {
123+ impl < F : Field > AddAssign for EagerField < U1 , F > {
124124 fn add_assign ( & mut self , other : Self ) {
125125 self . 0 . add_assign ( other. 0 ) ;
126126 }
127127}
128- impl < F : Field > SubAssign for EagerField < U0 , F > {
128+ impl < F : Field > SubAssign for EagerField < U1 , F > {
129129 fn sub_assign ( & mut self , other : Self ) {
130130 self . 0 . sub_assign ( other. 0 ) ;
131131 }
132132}
133- impl < F : Field > MulAssign for EagerField < U0 , F > {
133+ impl < F : Field > MulAssign for EagerField < U1 , F > {
134134 fn mul_assign ( & mut self , other : Self ) {
135135 self . 0 . mul_assign ( other. 0 ) ;
136136 }
137137}
138- impl < ' a , F : Field > AddAssign < & ' a Self > for EagerField < U0 , F > {
138+ impl < ' a , F : Field > AddAssign < & ' a Self > for EagerField < U1 , F > {
139139 fn add_assign ( & mut self , other : & ' a Self ) {
140140 self . 0 . add_assign ( & other. 0 ) ;
141141 }
142142}
143- impl < ' a , F : Field > SubAssign < & ' a Self > for EagerField < U0 , F > {
143+ impl < ' a , F : Field > SubAssign < & ' a Self > for EagerField < U1 , F > {
144144 fn sub_assign ( & mut self , other : & ' a Self ) {
145145 self . 0 . sub_assign ( & other. 0 ) ;
146146 }
147147}
148- impl < ' a , F : Field > MulAssign < & ' a Self > for EagerField < U0 , F > {
148+ impl < ' a , F : Field > MulAssign < & ' a Self > for EagerField < U1 , F > {
149149 fn mul_assign ( & mut self , other : & ' a Self ) {
150150 self . 0 . mul_assign ( & other. 0 ) ;
151151 }
152152}
153- impl < F : Field > Field for EagerField < U0 , F > {
153+ impl < F : Field > Field for EagerField < U1 , F > {
154154 const ZERO : Self = Self :: from ( F :: ZERO ) ;
155155 const ONE : Self = Self :: from ( F :: ONE ) ;
156156 fn try_from_rng < R : TryRngCore + ?Sized > ( rng : & mut R ) -> Result < Self , R :: Error > {
@@ -197,7 +197,7 @@ impl<F: Field> Field for EagerField<U0, F> {
197197}
198198
199199impl < U : Unsigned , F : Field > Reducible for EagerField < U , F > {
200- type Output = EagerField < U0 , F > ;
200+ type Output = EagerField < U1 , F > ;
201201 fn reduce ( & self ) -> Self :: Output {
202202 Self :: Output :: from ( self . 0 )
203203 }
0 commit comments