sigp / sha2_fixed_64

Optimised SHA256 for 64 byte messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sha2_fixed_64

A sha256 implementation optimised for 64 byte messages.

Production Readiness

This module is not production ready, it still in experimental phases.

Description

This library only supports hashing 64-byte messages. It uses an optimisation described by @potuz in this document.

The 64-byte message size makes this library perfect for computing the merkle root of two 32-byte leaves.

This library only supports x86 and x86_64. It requires the following CPU features:

  • sha
  • sse2
  • ssse3
  • sse4.1

The x86::cpu_is_supported function will return true if all these features are advertised as supported by your system.

Credits

This code is heavily inspired by (i.e., practically a copy of) the sha2 crate: https://github.com/RustCrypto/hashes/tree/master/sha2

License

Licensed under either of

  • Apache License, Version 2.0
  • MIT license

at your option.

About

Optimised SHA256 for 64 byte messages


Languages

Language:Rust 100.0%