Add Keccak256 syscall and sdk support (backport #16498) (#17157)

* Add Keccak256 syscall and sdk support (#16498)

(cherry picked from commit 8eb05d6ed4)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sha/Cargo.toml
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/Cargo.toml
#	sdk/program/Cargo.toml
#	sdk/program/src/lib.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-05-11 09:31:16 +00:00
committed by GitHub
parent f91d7da5a4
commit 3303ead54d
17 changed files with 368 additions and 74 deletions

View File

@@ -437,6 +437,24 @@ uint64_t sol_sha256(
const uint8_t *result
);
/**
* Length of a Keccak hash result
*/
#define KECCAK_RESULT_LENGTH 32
/**
* Keccak
*
* @param bytes Array of byte arrays
* @param bytes_len Number of byte arrays
* @param result 32 byte array to hold the result
*/
uint64_t sol_keccak256(
const SolBytes *bytes,
int bytes_len,
const uint8_t *result
);
/**
* Account Meta
*/