Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b8492f5

Browse files
committedMay 14, 2024·
address review
1 parent 1d5e09f commit b8492f5

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed
 

‎pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ markers = [
152152
"UniswapV2ERC20",
153153
"UniswapV2Factory",
154154
"EIP3074",
155+
"RIP7212",
155156
"UniswapV2Router",
156157
"AccountContract",
157158
"Utils",

‎src/kakarot/precompiles/precompiles.cairo

+5-6
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,17 @@ namespace Precompiles {
5858
if (is_rollup_precompile_ != 0) {
5959
// Rollup precompiles start at address 0x100. The last ethereum precompile is at address 0x0a.
6060
// The offset is computed as relative to the last ethereum precompile.
61-
tempvar offset = 1 + 3 * (
62-
(LAST_ETHEREUM_PRECOMPILE_ADDRESS + 1) +
63-
(evm_address - FIRST_ROLLUP_PRECOMPILE_ADDRESS)
61+
tempvar index = (LAST_ETHEREUM_PRECOMPILE_ADDRESS + 1) + (
62+
evm_address - FIRST_ROLLUP_PRECOMPILE_ADDRESS
6463
);
65-
tempvar range_check_ptr = range_check_ptr;
6664
} else {
6765
// Compute the corresponding offset in the jump table:
6866
// count 1 for "next line" and 3 steps per precompile evm_address: call, precompile, ret
69-
tempvar offset = 1 + 3 * evm_address;
70-
tempvar range_check_ptr = range_check_ptr;
67+
tempvar index = evm_address;
7168
}
7269

70+
tempvar offset = 1 + 3 * index;
71+
7372
// Prepare arguments
7473
[ap] = syscall_ptr, ap++;
7574
[ap] = pedersen_ptr, ap++;

‎tests/end_to_end/RIP7212/test_rip_7212.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ async def p256_verify_invoker(deploy_contract, owner):
1414

1515

1616
@pytest.mark.asyncio(scope="package")
17-
@pytest.mark.EIP3074
18-
class TestEIP3074:
19-
class TestEIP3074Integration:
20-
async def test_should_execute_authorized_call(self, p256_verify_invoker, owner):
17+
@pytest.mark.RIP7212
18+
class TestRIP7212:
19+
class TestRIP7212Integration:
20+
async def test_should_verify_secp256r1_signature(
21+
self, p256_verify_invoker, owner
22+
):
2123

2224
# input data from <https://github.com/ulerdogan/go-ethereum/blob/75062a6998e4e3fbb4cdb623b8b02e79e7b8f965/core/vm/contracts_test.go#L401-L410>
2325
input_data = (
24-
"4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4d",
25-
"a73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac",
26-
"36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d60",
27-
"4aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff3",
28-
"7618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e",
26+
"4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4d"
27+
"a73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac"
28+
"36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d60"
29+
"4aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff3"
30+
"7618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e"
2931
)
30-
msg_hash, r_, s_, x_, y_ = [["0x" + word for word in wrap(input_data, 64)]]
32+
msg_hash, r_, s_, x_, y_ = ["0x" + word for word in wrap(input_data, 64)]
3133
is_valid = await p256_verify_invoker.p256verify(
3234
msg_hash,
3335
r_,

0 commit comments

Comments
 (0)
This repository has been archived.