NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
73 stars 43 forks source link

Implement EcMulInner #454

Closed har777 closed 1 month ago

har777 commented 1 month ago

Fix #453

har777 commented 1 month ago

lgtm @har777 !

Just to confirm, you dont need to apply scalar % PRIME because the scalar operander willl never be > PRIME right (because we resolve as felt)?

Yep thats what I was thinking!

TAdev0 commented 1 month ago

@har777 mmh ok!

ids.scalar is a BigInt3 :

struct BigInt3 {
    d0: felt,
    d1: felt,
    d2: felt,
}

are you sure resolving this as a felt will work when running a cairo file?

TAdev0 commented 1 month ago

I think current impl is wrong A bigint3 takes 3 memory slots

What you do is retrieving only the first field of the struct

TAdev0 commented 1 month ago

Oh no my bad , it's a bigInt3 in ec mull , not in ec mull inner

All good !