[−][src]Crate lsx
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.
Usage
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 respective module documentation for further information.
License
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.
Re-exports
pub use sha256::RawSha256; |
pub use sha256::BufSha256; |
pub use twofish::Twofish; |
Modules
sha256 | An implementation of the SHA-256 cryptographic hash function, in both
buffered and unbuffered flavors. Enabled by default, or if you request the
|
twofish | An implementation of the Twofish block cipher. Only the primitive
operation is supported; you will have to provide the rest (e.g. a
particular CTR or CBC scheme) yourself. Enabled by default, or if you
request the |