22
22
#define load24_littleendian MLKEM_NAMESPACE(load24_littleendian)
23
23
/* End of static namespacing */
24
24
25
- static unsigned int rej_uniform_scalar (int16_t * r , unsigned int target ,
26
- unsigned int offset , const uint8_t * buf ,
27
- unsigned int buflen )
25
+ static unsigned rej_uniform_scalar (int16_t * r , unsigned target , unsigned offset ,
26
+ const uint8_t * buf , unsigned buflen )
28
27
__contract__ (
29
28
requires (offset <= target && target <= 4096 && buflen <= 4096 && buflen % 3 == 0 )
30
29
requires (memory_no_alias (r , sizeof (int16_t ) * target ))
@@ -35,7 +34,7 @@ __contract__(
35
34
ensures (array_bound (r , 0 , return_value , 0 , MLKEM_Q ))
36
35
)
37
36
{
38
- unsigned int ctr , pos ;
37
+ unsigned ctr , pos ;
39
38
uint16_t val0 , val1 ;
40
39
41
40
debug_assert_bound (r , offset , 0 , MLKEM_Q );
@@ -73,15 +72,15 @@ __contract__(
73
72
* uniform random integers mod q
74
73
*
75
74
* Arguments: - int16_t *r: pointer to output buffer
76
- * - unsigned int target: requested number of 16-bit integers
75
+ * - unsigned target: requested number of 16-bit integers
77
76
* (uniform mod q).
78
77
* Must be <= 4096.
79
- * - unsigned int offset: number of 16-bit integers that have
78
+ * - unsigned offset: number of 16-bit integers that have
80
79
* already been sampled.
81
80
* Must be <= target.
82
81
* - const uint8_t *buf: pointer to input buffer
83
82
* (assumed to be uniform random bytes)
84
- * - unsigned int buflen: length of input buffer in bytes
83
+ * - unsigned buflen: length of input buffer in bytes
85
84
* Must be <= 4096.
86
85
* Must be a multiple of 3.
87
86
*
@@ -102,9 +101,8 @@ __contract__(
102
101
* buffer. This avoids shifting the buffer base in the caller, which appears
103
102
* tricky to reason about.
104
103
*/
105
- static unsigned int rej_uniform (int16_t * r , unsigned int target ,
106
- unsigned int offset , const uint8_t * buf ,
107
- unsigned int buflen )
104
+ static unsigned rej_uniform (int16_t * r , unsigned target , unsigned offset ,
105
+ const uint8_t * buf , unsigned buflen )
108
106
__contract__ (
109
107
requires (offset <= target && target <= 4096 && buflen <= 4096 && buflen % 3 == 0 )
110
108
requires (memory_no_alias (r , sizeof (int16_t ) * target ))
@@ -146,9 +144,9 @@ void poly_rej_uniform_x4(poly *vec, uint8_t *seed[4])
146
144
uint8_t buf3 [MLKEM_GEN_MATRIX_NBLOCKS * XOF_RATE ];
147
145
148
146
/* Tracks the number of coefficients we have already sampled */
149
- unsigned int ctr [KECCAK_WAY ];
147
+ unsigned ctr [KECCAK_WAY ];
150
148
xof_x4_ctx statex ;
151
- unsigned int buflen ;
149
+ unsigned buflen ;
152
150
153
151
/* seed is MLKEM_SYMBYTES + 2 bytes long, but padded to MLKEM_SYMBYTES + 16 */
154
152
xof_x4_init (& statex );
@@ -199,7 +197,7 @@ void poly_rej_uniform(poly *entry, uint8_t seed[MLKEM_SYMBYTES + 2])
199
197
{
200
198
xof_ctx state ;
201
199
uint8_t buf [MLKEM_GEN_MATRIX_NBLOCKS * XOF_RATE ];
202
- unsigned int ctr , buflen ;
200
+ unsigned ctr , buflen ;
203
201
204
202
xof_init (& state );
205
203
xof_absorb (& state , seed , MLKEM_SYMBYTES + 2 );
0 commit comments