MCPcopy Index your code
hub / github.com/RustCrypto/block-ciphers

github.com/RustCrypto/block-ciphers @cast6-v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release cast6-v0.2.0 ↗ · + Follow
690 symbols 1,492 edges 140 files 75 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

RustCrypto: block ciphers

Project Chat dependency status Apache2/MIT licensed [HAZMAT]hazmat-link

Collection of block ciphers written in pure Rust.

Higher level constructions

Crates in this repository implement ONLY raw block cipher functionality defined by traits in the [cipher] crate. In practice block ciphers are rarely used in isolation. Instead, they usually play role of a building block for higher level constructions. In RustCrypto such constructions are implemented generically over block ciphers in separate repositories: - AEADs: GCM, SIV, CCM, MGM, etc. - MACs: CMAC, PMAC. - Block modes: CTR, CBC, CFB, etc. - Key wrapping: AES-KW.

Most users should use constructions defined in these repositories without directly relying on raw block cipher functionality.

Warnings

Currently only the aes crate provides constant-time implementation and has received a third-party security audit.

Other crates in this repository are not implemented in a constant-time manner and have not yet received any formal cryptographic and security reviews.

It's generally recommended not to use other cipher implementations in this repository besides the aes crate.

USE AT YOUR OWN RISK.

Supported algorithms

Name Crate name crates.io Docs MSRV
AES (Rijndael) [aes] crates.io Documentation MSRV 1.85
ARIA [aria] crates.io Documentation MSRV 1.85
BelT block cipher [belt-block] crates.io Documentation MSRV 1.85
Blowfish [blowfish] crates.io Documentation MSRV 1.85
Camellia [camellia] crates.io Documentation MSRV 1.85
CAST5 (CAST-128) [cast5] crates.io Documentation MSRV 1.85
CAST6 (CAST-256) [cast6] crates.io Documentation MSRV 1.85
DES + 3DES (DEA, 3DEA) [des] crates.io Documentation MSRV 1.85
Gift [gift-cipher] crates.io Documentation MSRV 1.85
IDEA [idea] crates.io Documentation MSRV 1.85
Kuznyechik (GOST R 34.12-2015) [kuznyechik] crates.io Documentation MSRV 1.85
Magma (GOST R 34.12-2015) [magma] crates.io Documentation MSRV 1.85
RC2 (ARC2) [rc2] crates.io Documentation MSRV 1.85
RC5 [rc5] crates.io Documentation MSRV 1.85
RC6 [rc6] crates.io Documentation MSRV 1.85
Serpent [serpent] crates.io Documentation MSRV 1.85
SM4 [sm4] crates.io Documentation MSRV 1.85
Speck [speck-cipher] crates.io Documentation MSRV 1.85
Threefish [threefish] crates.io Documentation MSRV 1.85
Twofish [twofish] crates.io Documentation MSRV 1.85
XTEA [xtea] crates.io Documentation MSRV 1.85

License

All crates licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

Sbox (Interface)
Trait for GOST 28147-89 cipher S-boxes [6 implementers]
magma/src/sboxes.rs
Word (Interface)
(no doc) [5 implementers]
rc5/src/primitives.rs
Word (Interface)
(no doc) [4 implementers]
rc6/src/core/primitives.rs
SboxExt (Interface)
Extension of the `Sbox` trait which provides expanded S-Box and helper methods [1 implementers]
magma/src/sboxes.rs
Sealed (Interface)
(no doc) [5 implementers]
rc5/src/primitives.rs

Core symbols most depended-on inside this repo

wrapping_add
called by 92
rc5/src/primitives.rs
rotate_left
called by 66
rc5/src/primitives.rs
rotate_right
called by 47
rc5/src/primitives.rs
swapmovesingle
called by 41
gift-cipher/src/primitives.rs
to_le_bytes
called by 39
rc5/src/primitives.rs
a
called by 39
aria/src/utils.rs
add_round_key
called by 36
aes/src/soft/fixslice32.rs
add_round_key
called by 36
aes/src/soft/fixslice64.rs

Shape

Function 365
Method 260
Class 53
Enum 7
Interface 5

Languages

Rust100%

Modules by API surface

aes/src/soft/fixslice64.rs45 symbols
aes/src/soft/fixslice32.rs43 symbols
serpent/src/bitslice.rs20 symbols
blowfish/src/lib.rs20 symbols
gift-cipher/src/primitives.rs19 symbols
twofish/src/lib.rs18 symbols
rc2/src/lib.rs16 symbols
idea/src/lib.rs16 symbols
cast6/src/lib.rs16 symbols
rc5/src/lib.rs15 symbols
gift-cipher/src/key_schedule.rs15 symbols
sm4/src/lib.rs14 symbols

For agents

$ claude mcp add block-ciphers \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact