Skip to content

Commit

Permalink
Rename instruction SHA3 -> KECCAK256
Browse files Browse the repository at this point in the history
As proposed by EIP-1803 https://eips.ethereum.org/EIPS/eip-1803
and already done in many other projects, including solidity and
ethereum-js.
  • Loading branch information
chfast committed Apr 26, 2021
1 parent 799278b commit 923d6c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/evmc/instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ enum evmc_opcode
OP_SHR = 0x1c,
OP_SAR = 0x1d,

OP_SHA3 = 0x20,
OP_KECCAK256 = 0x20,

OP_ADDRESS = 0x30,
OP_BALANCE = 0x31,
Expand Down
14 changes: 7 additions & 7 deletions lib/instructions/instruction_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static struct evmc_instruction_metrics berlin_metrics[256] = {
/* SAR = 0x1d */ {VERYLOW, 2, -1},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -323,7 +323,7 @@ static struct evmc_instruction_metrics istanbul_metrics[256] = {
/* SAR = 0x1d */ {VERYLOW, 2, -1},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -582,7 +582,7 @@ static struct evmc_instruction_metrics constantinople_metrics[256] = {
/* SAR = 0x1d */ {VERYLOW, 2, -1},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -841,7 +841,7 @@ static struct evmc_instruction_metrics byzantium_metrics[256] = {
/* = 0x1d */ {UNDEFINED, 0, 0},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -1100,7 +1100,7 @@ static struct evmc_instruction_metrics tangerine_whistle_metrics[256] = {
/* = 0x1d */ {UNDEFINED, 0, 0},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -1359,7 +1359,7 @@ static struct evmc_instruction_metrics homestead_metrics[256] = {
/* = 0x1d */ {UNDEFINED, 0, 0},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down Expand Up @@ -1618,7 +1618,7 @@ static struct evmc_instruction_metrics frontier_metrics[256] = {
/* = 0x1d */ {UNDEFINED, 0, 0},
/* = 0x1e */ {UNDEFINED, 0, 0},
/* = 0x1f */ {UNDEFINED, 0, 0},
/* SHA3 = 0x20 */ {30, 2, -1},
/* KECCAK256 = 0x20 */ {30, 2, -1},
/* = 0x21 */ {UNDEFINED, 0, 0},
/* = 0x22 */ {UNDEFINED, 0, 0},
/* = 0x23 */ {UNDEFINED, 0, 0},
Expand Down
10 changes: 5 additions & 5 deletions lib/instructions/instruction_names.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static const char* istanbul_names[256] = {
/* 0x1d */ "SAR",
/* 0x1e */ NULL,
/* 0x1f */ NULL,
/* 0x20 */ "SHA3",
/* 0x20 */ "KECCAK256",
/* 0x21 */ NULL,
/* 0x22 */ NULL,
/* 0x23 */ NULL,
Expand Down Expand Up @@ -297,7 +297,7 @@ static const char* constantinople_names[256] = {
/* 0x1d */ "SAR",
/* 0x1e */ NULL,
/* 0x1f */ NULL,
/* 0x20 */ "SHA3",
/* 0x20 */ "KECCAK256",
/* 0x21 */ NULL,
/* 0x22 */ NULL,
/* 0x23 */ NULL,
Expand Down Expand Up @@ -556,7 +556,7 @@ static const char* byzantium_names[256] = {
/* 0x1d */ NULL,
/* 0x1e */ NULL,
/* 0x1f */ NULL,
/* 0x20 */ "SHA3",
/* 0x20 */ "KECCAK256",
/* 0x21 */ NULL,
/* 0x22 */ NULL,
/* 0x23 */ NULL,
Expand Down Expand Up @@ -815,7 +815,7 @@ static const char* homestead_names[256] = {
/* 0x1d */ NULL,
/* 0x1e */ NULL,
/* 0x1f */ NULL,
/* 0x20 */ "SHA3",
/* 0x20 */ "KECCAK256",
/* 0x21 */ NULL,
/* 0x22 */ NULL,
/* 0x23 */ NULL,
Expand Down Expand Up @@ -1074,7 +1074,7 @@ static const char* frontier_names[256] = {
/* 0x1d */ NULL,
/* 0x1e */ NULL,
/* 0x1f */ NULL,
/* 0x20 */ "SHA3",
/* 0x20 */ "KECCAK256",
/* 0x21 */ NULL,
/* 0x22 */ NULL,
/* 0x23 */ NULL,
Expand Down

0 comments on commit 923d6c9

Please sign in to comment.