mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-06 15:53:10 +00:00
Merge branch 'main' into rlp_3
This commit is contained in:
commit
0ba6078984
@ -40,14 +40,18 @@ pub fn fixed_base_curve_mul_circuit<C: Curve, F: RichField + Extendable<D>, cons
|
||||
// `s * P = sum s_i * P_i` with `P_i = (16^i) * P` and `s = sum s_i * (16^i)`.
|
||||
for (limb, point) in limbs.into_iter().zip(scaled_base) {
|
||||
// `muls_point[t] = t * P_i` for `t=0..16`.
|
||||
let muls_point = (0..16)
|
||||
let mut muls_point = (0..16)
|
||||
.scan(AffinePoint::ZERO, |acc, _| {
|
||||
let tmp = *acc;
|
||||
*acc = (point + *acc).to_affine();
|
||||
Some(tmp)
|
||||
})
|
||||
// First element if zero, so we skip it since `constant_affine_point` takes non-zero input.
|
||||
.skip(1)
|
||||
.map(|p| builder.constant_affine_point(p))
|
||||
.collect::<Vec<_>>();
|
||||
// We add back a point in position 0. `limb == zero` is checked below, so this point can be arbitrary.
|
||||
muls_point.insert(0, muls_point[0].clone());
|
||||
let is_zero = builder.is_equal(limb, zero);
|
||||
let should_add = builder.not(is_zero);
|
||||
// `r = s_i * P_i`
|
||||
|
||||
@ -50,8 +50,8 @@ pub(crate) fn combined_kernel() -> Kernel {
|
||||
include_str!("asm/rlp/encode.asm"),
|
||||
include_str!("asm/rlp/decode.asm"),
|
||||
include_str!("asm/rlp/read_to_memory.asm"),
|
||||
include_str!("asm/storage_read.asm"),
|
||||
include_str!("asm/storage_write.asm"),
|
||||
include_str!("asm/storage/read.asm"),
|
||||
include_str!("asm/storage/write.asm"),
|
||||
include_str!("asm/transactions/process_normalized.asm"),
|
||||
include_str!("asm/transactions/router.asm"),
|
||||
include_str!("asm/transactions/type_0.asm"),
|
||||
|
||||
2
evm/src/cpu/kernel/asm/storage/read.asm
Normal file
2
evm/src/cpu/kernel/asm/storage/read.asm
Normal file
@ -0,0 +1,2 @@
|
||||
global storage_read:
|
||||
// TODO
|
||||
2
evm/src/cpu/kernel/asm/storage/write.asm
Normal file
2
evm/src/cpu/kernel/asm/storage/write.asm
Normal file
@ -0,0 +1,2 @@
|
||||
global storage_write:
|
||||
// TODO
|
||||
@ -1,10 +0,0 @@
|
||||
// TODO: Dummy code for now.
|
||||
global storage_read:
|
||||
JUMPDEST
|
||||
PUSH 1234
|
||||
POP
|
||||
// An infinite loop:
|
||||
mylabel:
|
||||
JUMPDEST
|
||||
PUSH mylabel
|
||||
JUMP
|
||||
@ -1,6 +0,0 @@
|
||||
// TODO: Dummy code for now.
|
||||
global storage_write:
|
||||
JUMPDEST
|
||||
PUSH 123 // Whatever.
|
||||
POP
|
||||
BYTES 0x1, 0x02, 3
|
||||
Loading…
x
Reference in New Issue
Block a user