MCPcopy Index your code
hub / github.com/DaGenix/rust-crypto

github.com/DaGenix/rust-crypto @v0.2.36

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.36 ↗ · + Follow
841 symbols 2,037 edges 45 files 164 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust-Crypto

Build Status

A (mostly) pure-Rust implementation of various common cryptographic algorithms.

Rust-Crypto seeks to create practical, auditable, pure-Rust implementations of common cryptographic algorithms with a minimum amount of assembly code where appropriate. The x86-64, x86, and ARM architectures are supported, although the x86-64 architecture receives the most testing.

Rust-Crypto targets the current, stable build of Rust. If you are having issues while using an older version, please try upgrading to the latest stable.

Rust-Crypto has not been thoroughly audited for correctness, so any use where security is important is not recommended at this time.

Usage

To use Rust-Crypto, add the following to your Cargo.toml:

[dependencies]
rust-crypto = "^0.2"

and the following to your crate root:

extern crate crypto;

Contributions

Contributions are extremely welcome. The most significant needs are help adding documentation, implementing new algorithms, and general cleanup and improvement of the code. By submitting a pull request you are agreeing to make you work available under the license terms of the Rust-Crypto project.

License

Rust-Crypto is dual licensed under the MIT and Apache 2.0 licenses, the same licenses as the Rust compiler.

Algorithms

Rust-Crypto already supports a significant number of algorithms and with your help it will support even more in the future. Currently supported algorithms include:

  • AES
  • Bcrypt
  • Blake2B
  • Blowfish
  • ChaCha20
  • Curve25519
  • ECB, CBC, and CTR block cipher modes
  • Ed25519
  • Fortuna
  • Ghash
  • HC128
  • HMAC
  • MD5
  • PBKDF2
  • PKCS padding for CBC block cipher mode
  • Poly1305
  • RC4
  • RIPEMD-160
  • Salsa20 and XSalsa20
  • Scrypt
  • Sha1
  • Sha2 (All fixed output size variants)
  • Sosemanuk
  • Whirlpool

Extension points exported contracts — how you extend this code

Digest (Interface)
* The Digest trait specifies an interface common to digest functions, such as SHA-1 and the SHA-2 * family of digest fu [13 …
src/digest.rs
Mac (Interface)
* The Mac trait defines methods for a Message Authentication function. */ [5 implementers]
src/mac.rs
Encryptor (Interface)
(no doc) [10 implementers]
src/symmetriccipher.rs
BlockProcessor (Interface)
The BlockProcessor trait is used to implement modes that require processing complete blocks of data. The methods of this [4 …
src/blockmodes.rs
WriteBuffer (Interface)
(no doc) [3 implementers]
src/buffer.rs
WriteExt (Interface)
An extension trait to implement a few useful serialization methods on types that implement Write [1 implementers]
src/cryptoutil.rs
AesOps (Interface)
This trait defines all of the operations needed for a type to be processed as part of an AES encryption or decryption op [1 …
src/aessafe.rs
AeadEncryptor (Interface)
(no doc) [2 implementers]
src/aead.rs

Core symbols most depended-on inside this repo

read_u32_le
called by 71
src/cryptoutil.rs
lsh
called by 56
src/aessafe.rs
rsh
called by 56
src/aessafe.rs
pb
called by 48
src/aessafe.rs
write_u32_be
called by 39
src/cryptoutil.rs
load_3i
called by 37
src/curve25519.rs
copy_memory
called by 37
src/cryptoutil.rs
next
called by 36
src/rc4.rs

Shape

Function 368
Method 339
Class 101
Interface 26
Enum 7

Languages

Rust99%
C1%

Modules by API surface

src/blockmodes.rs62 symbols
src/aessafe.rs59 symbols
src/sha2.rs52 symbols
src/curve25519.rs51 symbols
src/sha3.rs42 symbols
src/cryptoutil.rs40 symbols
src/blake2s.rs31 symbols
src/blake2b.rs31 symbols
src/buffer.rs30 symbols
src/aes.rs30 symbols
src/sha1.rs28 symbols
src/fortuna.rs27 symbols

For agents

$ claude mcp add rust-crypto \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact