1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! SM4 block cipher (GB/T 32907-2016) and operating modes.
//!
//! v0.2 ships:
//!
//! - The raw 128-bit block cipher [`cipher::Sm4Cipher`].
//! - SM4-CBC with PKCS#7 padding (single-shot, [`mode_cbc::encrypt`] /
//! [`mode_cbc::decrypt`]).
//!
//! v0.3 W5 adds streaming wrappers:
//!
//! - [`cbc_streaming::Sm4CbcEncryptor`] / [`cbc_streaming::Sm4CbcDecryptor`].
//!
//! v0.7 W2 adds SM4-CTR (counter mode; unauthenticated stream cipher):
//!
//! - [`mode_ctr::encrypt`] / [`mode_ctr::decrypt`] (single-shot).
//!
//! v0.7 W3 adds the streaming SM4-CTR counterpart:
//!
//! - [`ctr_streaming::Sm4CtrCipher`] (symmetric — serves both directions).
//!
//! See [`cipher`]'s module-doc for the constant-time stance, throughput
//! cost, and KAT sources.
// v0.4 W3 — Bitsliced (table-less, gate-only) SM4 S-box behind the
// `sm4-bitsliced` feature flag (Q4.9 / Q4.10 / Q4.11 of
// docs/v0.4-scope.md). The module is `pub(crate)` so `cipher.rs`'s
// `tau` can swap to it when the feature is on; not in the public API.
//
// When `sm4-bitsliced-simd` is also enabled, `tau` dispatches into
// `sbox_bitsliced_simd::sbox` instead (which calls the sibling
// crate). The v0.4 W3 module then becomes dead code at the
// non-test build path, but its `tests::bitsliced_matches_table` is
// still useful as an algorithmic correctness gate and as a
// reference for `sbox_bitsliced_simd::tests::simd_sbox_matches_single_block`.
pub
// v0.5 W4 — Multi-block SIMD-packed bitsliced SM4 S-box behind the
// `sm4-bitsliced-simd` feature flag (Q5.10–Q5.15 of
// docs/v0.5-scope.md). Phase 1 ships scaffolding only — the module
// delegates transparently to `sbox_bitsliced` so the cfg-dispatch
// path, dudect target, and CI matrix entry land before the AVX2
// (phase 2) / NEON (phase 3) intrinsic implementations.
pub
pub use ;
pub use ;
pub use Sm4CtrCipher;