Skip to content

Commit

Permalink
Merge pull request #590 from ethereum/rename_sha3_to_keccak256
Browse files Browse the repository at this point in the history
Rename instruction SHA3 -> KECCAK256
  • Loading branch information
chfast authored Apr 26, 2021
2 parents a1130d6 + 2ba8647 commit a740dfb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning].
`access_account()` and `access_storage()` functions added to `evmc_host_interface`.
[#571](https://github.com/ethereum/evmc/pull/571)

### Changed

- Instruction `SHA3` has been renamed to `KECCAK256` as proposed by
[EIP-1803](https://eips.ethereum.org/EIPS/eip-1803) to better match the underlying hash function.
[#590](https://github.com/ethereum/evmc/pull/590)

## [7.5.0] — 2021-03-23

### Added
Expand Down
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 a740dfb

Please sign in to comment.