About this project

tc_rust is a pure-Rust cryptography workspace ported from the Bouncy Castle C# library. It serves as a personal learning project for studying Rust, cryptographic algorithms, and API design. The project is explicitly marked as an independent, unofficial reimplementation that is not affiliated with or endorsed by the Legion of the Bouncy Castle Inc. Due to its status as a work-in-progress with unstable APIs and no security audit, it is not suitable for production or real-world security applications. The library provides a comprehensive set of cryptographic primitives organized into modular crates. Block cipher support includes 28 public engines such as AES, ARIA, Camellia, DES, and SM4, with known-answer tests. Stream cipher engines cover RC4, ChaCha, Salsa20, and HC-128/256. The project also implements eight block cipher mode families, including ECB, CBC, CTR, and GCTR, though padding and authentication are not provided. Digest support is extensive, featuring 45 exported types including SHA-2/3, BLAKE2/3, MD5, and RIPEMD variants. Mathematical foundations include arbitrary-precision integers, binary field arithmetic, and elliptic curve operations for SEC and SM2 curves. It supports X25519/X448 key exchange and Ed25519/Ed448 signatures with strict verification modes. Key wrapping implementations follow RFC 3394, RFC 5649, and DSTU 7624 standards. The architecture emphasizes `no_std` compatibility, with crates ranging from core-only to those requiring `alloc` or `std` for performance optimizations like AES-NI and AVX2 acceleration. The dependency graph is designed to be acyclic, allowing users to select only the necessary layers. The project is licensed under MIT or Apache-2.0.