@@ -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
) ;
@@ -288,12 +282,9 @@ impl Runtime {
288
282
link ~> tmp2_col = regs.mload(Y, STEP + 1)
289
283
link ~> poseidon2_gl.poseidon2_permutation(tmp1_col, tmp2_col, STEP)
290
284
{
291
- // make sure tmp1_col and tmp2_col are aligned memory addresses
292
- tmp3_col * 4 = tmp1_col,
293
- tmp4_col * 4 = tmp2_col,
294
- // make sure the addresses are 32 bits
295
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
296
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
285
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
286
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
287
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
297
288
}
298
289
"# ] ,
299
290
) ;
@@ -309,12 +300,9 @@ impl Runtime {
309
300
link ~> tmp2_col = regs.mload(Y, STEP + 1)
310
301
link ~> split_gl_vec.split(tmp1_col, tmp2_col, STEP + 2)
311
302
{
312
- // make sure tmp1_col and tmp2_col are aligned memory addresses
313
- tmp3_col * 4 = tmp1_col,
314
- tmp4_col * 4 = tmp2_col,
315
- // make sure the addresses are 32 bits
316
- tmp3_col = X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000,
317
- tmp4_col = Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000
303
+ // make sure tmp1_col and tmp2_col are 4-byte aligned memory addresses
304
+ tmp1_col = 4 * (X_b1 + X_b2 * 0x100 + X_b3 * 0x10000 + X_b4 * 0x1000000),
305
+ tmp2_col = 4 * (Y_b5 + Y_b6 * 0x100 + Y_b7 * 0x10000 + Y_b8 * 0x1000000)
318
306
}
319
307
"# ,
320
308
r#"
0 commit comments