@@ -172,12 +172,9 @@ impl Runtime {
172
172
link ~> tmp2_col = regs.mload(Y, STEP + 1)
173
173
link ~> keccakf.keccakf32_memory(tmp1_col, tmp2_col, STEP)
174
174
{
175
- // make sure tmp1_col and tmp2_col are aligned memory addresses
176
- tmp3_col * 4 = tmp1_col,
177
- tmp4_col * 4 = tmp2_col,
178
- // make sure the factors fit in 32 bits
179
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
180
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
175
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
176
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
177
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
181
178
}
182
179
"#
183
180
. to_string ( ) ] ,
@@ -257,12 +254,9 @@ impl Runtime {
257
254
link ~> tmp2_col = regs.mload(Y, STEP + 1)
258
255
link ~> poseidon_gl.poseidon_permutation(tmp1_col, tmp2_col, STEP)
259
256
{
260
- // make sure tmp1_col and tmp2_col are aligned memory addresses
261
- tmp3_col * 4 = tmp1_col,
262
- tmp4_col * 4 = tmp2_col,
263
- // make sure the factors fit in 32 bits
264
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
265
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
257
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
258
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
259
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
266
260
}
267
261
"# ] ,
268
262
) ;
@@ -289,12 +283,9 @@ impl Runtime {
289
283
link ~> tmp?_col = regs.mload(Z, STEP + 2)
290
284
link ~> poseidon2_gl.permute(tmp1_col, STEP, tmp2_col, STEP + 1, tmp?_col)
291
285
{
292
- // make sure tmp1_col and tmp2_col are aligned memory addresses
293
- tmp3_col * 4 = tmp1_col,
294
- tmp4_col * 4 = tmp2_col,
295
- // make sure the addresses are 32 bits
296
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
297
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
286
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
287
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
288
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
298
289
}
299
290
"# ] ,
300
291
) ;
@@ -310,12 +301,9 @@ impl Runtime {
310
301
link ~> tmp2_col = regs.mload(Y, STEP + 1)
311
302
link ~> split_gl_vec.split(tmp1_col, tmp2_col, STEP)
312
303
{
313
- // make sure tmp1_col and tmp2_col are aligned memory addresses
314
- tmp3_col * 4 = tmp1_col,
315
- tmp4_col * 4 = tmp2_col,
316
- // make sure the addresses are 32 bits
317
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
318
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
304
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
305
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
306
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
319
307
}
320
308
"# ,
321
309
r#"
0 commit comments