#sha-256 #twofish

no-std lsx

A pure, safe Rust implementation of the Twofish block cipher and the SHA-256 cryptographic hash function

2 stable releases

1.1.2 Jul 3, 2020

#659 in #cryptography

Download history 49/week @ 2023-07-19 38/week @ 2023-07-26 20/week @ 2023-08-02 33/week @ 2023-08-09 36/week @ 2023-08-16 24/week @ 2023-08-23 17/week @ 2023-08-30 41/week @ 2023-09-06 32/week @ 2023-09-13 13/week @ 2023-09-20 27/week @ 2023-09-27 21/week @ 2023-10-04 28/week @ 2023-10-11 37/week @ 2023-10-18 34/week @ 2023-10-25 41/week @ 2023-11-01

143 downloads per month
Used in 5 crates

Zlib license


This is a pure, safe Rust reimplementation of LibSolraXandria. It provides implementations of the Twofish block cipher and the SHA-256 cryptographic hash function.

Like its C99 ancestor, the library is fairly simple, runs with reasonable speed, uses very little memory, and makes no use whatsoever of the heap (but you are, of course, free to allocate its state objects on the heap rather than the stack if you want to). Unlike its C99 ancestor, it is written 100% in safe Rust code. This does not come at any cost in performance; the Rust version and its C99 ancestor are generally neck and neck in benchmarks.

Theoretically, std is not required, but this has not been tested.


Add to your Cargo.toml, under [dependencies]:

lsx = "1.1"

Or, if you want only SHA-256 support:

lsx = {version = "1.1", default-features = false, features = ["sha256"]}

Or only Twofish:

lsx = {version = "1.1", default-features = false, features = ["twofish"]}

See the module documentation for further information. You can either read it online, or set up the dependency in your Cargo.toml and use cargo doc.


This library is distributed under the zlib license. This puts very few restrictions on use. See LICENSE.md for the complete, very short text of the license.