@@ -117,7 +117,7 @@ public void lift(Polynomial a)
117
117
/* NOTE: Assumes input is in {0,1,2}^N */
118
118
/* Produces output in [0,Q-1]^N */
119
119
int i ;
120
- HRSSPolynomial b = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
120
+ Polynomial b = this .params . createPolynomial ( );
121
121
short t , zj ;
122
122
123
123
/* Define z by <z*x^i, x-1> = delta_{i,0} mod 3: */
@@ -166,30 +166,30 @@ public void lift(Polynomial a)
166
166
@ Override
167
167
public void r2Inv (Polynomial a )
168
168
{
169
- HRSSPolynomial f = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
170
- HRSSPolynomial g = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
171
- HRSSPolynomial v = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
172
- HRSSPolynomial w = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
169
+ Polynomial f = this .params . createPolynomial ( );
170
+ Polynomial g = this .params . createPolynomial ( );
171
+ Polynomial v = this .params . createPolynomial ( );
172
+ Polynomial w = this .params . createPolynomial ( );
173
173
this .r2Inv (a , f , g , v , w );
174
174
}
175
175
176
176
@ Override
177
177
public void rqInv (Polynomial a )
178
178
{
179
- HRSSPolynomial ai2 = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
180
- HRSSPolynomial b = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
181
- HRSSPolynomial c = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
182
- HRSSPolynomial s = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
179
+ Polynomial ai2 = this .params . createPolynomial ( );
180
+ Polynomial b = this .params . createPolynomial ( );
181
+ Polynomial c = this .params . createPolynomial ( );
182
+ Polynomial s = this .params . createPolynomial ( );
183
183
this .rqInv (a , ai2 , b , c , s );
184
184
}
185
185
186
186
@ Override
187
187
public void s3Inv (Polynomial a )
188
188
{
189
- HRSSPolynomial f = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
190
- HRSSPolynomial g = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
191
- HRSSPolynomial v = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
192
- HRSSPolynomial w = new HRSSPolynomial (( NTRUHRSSParameterSet ) this .params );
189
+ Polynomial f = this .params . createPolynomial ( );
190
+ Polynomial g = this .params . createPolynomial ( );
191
+ Polynomial v = this .params . createPolynomial ( );
192
+ Polynomial w = this .params . createPolynomial ( );
193
193
this .s3Inv (a , f , g , v , w );
194
194
}
195
195
}
0 commit comments