@@ -142,7 +142,7 @@ void poly_packcompress(unsigned char *r, poly *a, int i) {
142
142
d0 >>= 31 ;
143
143
t [k ] = d0 & 0x7ff ;
144
144
}
145
-
145
+
146
146
147
147
r [352 * i + 11 * j + 0 ] = t [0 ] & 0xff ;
148
148
r [352 * i + 11 * j + 1 ] = (t [0 ] >> 8 ) | ((t [1 ] & 0x1f ) << 3 );
@@ -366,6 +366,7 @@ void poly_tobytes(unsigned char *r, poly *a) {
366
366
int i ;
367
367
uint16_t t0 , t1 ;
368
368
369
+ poly_reduce (a );
369
370
poly_reduce (a );
370
371
371
372
for (i = 0 ; i < KYBER_N / 2 ; i ++ ) {
@@ -465,7 +466,7 @@ void poly_noise(poly *r, const unsigned char *seed, unsigned char nonce, int add
465
466
* Using strategy of better accumulation (initial step).
466
467
* Arguments: - const poly *a: pointer to input polynomial
467
468
* - const poly *b: pointer to input polynomial
468
- * - const poly *a_prime: pointer to a pre-multiplied by zetas
469
+ * - const poly *a_prime: pointer to a pre-multiplied by zetas
469
470
* - int32_t *r_tmp: array for accumulating unreduced results
470
471
**************************************************/
471
472
extern void basemul_asm_opt_16_32 (int32_t * , const int16_t * , const int16_t * , const int16_t * );
@@ -481,7 +482,7 @@ void poly_basemul_opt_16_32(int32_t *r_tmp, const poly *a, const poly *b, const
481
482
* Using strategy of better accumulation.
482
483
* Arguments: - const poly *a: pointer to input polynomial
483
484
* - const poly *b: pointer to input polynomial
484
- * - const poly *a_prime: pointer to a pre-multiplied by zetas
485
+ * - const poly *a_prime: pointer to a pre-multiplied by zetas
485
486
* - int32_t *r_tmp: array for accumulating unreduced results
486
487
**************************************************/
487
488
extern void basemul_asm_acc_opt_32_32 (int32_t * , const int16_t * , const int16_t * , const int16_t * );
@@ -497,7 +498,7 @@ void poly_basemul_acc_opt_32_32(int32_t *r_tmp, const poly *a, const poly *b, co
497
498
* Using strategy of better accumulation (final step).
498
499
* Arguments: - const poly *a: pointer to input polynomial
499
500
* - const poly *b: pointer to input polynomial
500
- * - const poly *a_prime: pointer to a pre-multiplied by zetas
501
+ * - const poly *a_prime: pointer to a pre-multiplied by zetas
501
502
* - poly *r: pointer to output polynomial
502
503
* - int32_t *r_tmp: array for accumulating unreduced results
503
504
**************************************************/
0 commit comments