solana-nostd-keccak

Crates.iosolana-nostd-keccak
lib.rssolana-nostd-keccak
version0.1.3
sourcesrc
created_at2024-09-12 03:42:54.318376
updated_at2024-09-12 10:26:38.604897
descriptionA more efficient implementation of Keccak256 for SVM
homepage
repository
max_upload_size
id1372461
size6,032
Dean 利迪恩 (deanmlittle)

documentation

README

Solana NoStd Keccak256

A more efficient implementation of Keccak256 for SVM.

Installation

cargo add solana-nostd-keccak

Features

  • Adds hash_ref which takes in any type that implements <AsRef<[u8]>>
  • No Hash struct. Returns [u8;32] directly.
  • Makes use of MaybeUninit to skip zero allocations
  • Adds hash_into to let you hash directly into a mutable buffer.

Performance

library function CU cost
nostd-keccak hashv(&[b"test"]) 100
nostd-keccak hash(b"test") 105
nostd-keccak hash_ref("test") 105
solana-program hashv(&[b"test"]) 121
solana-program hash(b"test") 123
Commit count: 0

cargo fmt