Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,32 @@ jobs:

- name: Run cargo fmt
run: cargo fmt --all -- --check

doc:
name: rustdoc
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
# We need Nightly for doc_cfg
toolchain: nightly-2026-03-29
- uses: Swatinem/rust-cache@v2
- name: Generate Docs
env:
RUSTDOCFLAGS: -Dwarnings --cfg docsrs
run: cargo doc --no-deps

typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: crate-ci/typos@v1

lockfile:
name: Check Cargo.lock
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --workspace --locked
10 changes: 10 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[files]
extend-exclude = [
".git/"
]

[default]
extend-ignore-re = [
# Patterns which appear to be 32 or more hex characters
'\b[0-9A-H+/]{32,}\b',
]
4 changes: 2 additions & 2 deletions chacha20/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ use hex_literal::hex;

let key = [0x42; 32];
let nonce = [0x24; 12];
let plaintext = hex!("00010203 04050607 08090A0B 0C0D0E0F");
let ciphertext = hex!("e405626e 4f1236b3 670ee428 332ea20e");
let plaintext = hex!("000102030405060708090A0B0C0D0E0F");
let ciphertext = hex!("e405626e4f1236b3670ee428332ea20e");

// Key and IV must be references to the `Array` type.
// Here we use the `Into` trait to convert arrays into it.
Expand Down
4 changes: 2 additions & 2 deletions hc-256/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use hex_literal::hex;

let key = [0x42; 32];
let nonce = [0x24; 32];
let plaintext = hex!("00010203 04050607 08090A0B 0C0D0E0F");
let ciphertext = hex!("ca982177 325cd40e bc208045 066c420f");
let plaintext = hex!("000102030405060708090A0B0C0D0E0F");
let ciphertext = hex!("ca982177325cd40ebc208045066c420f");

// Key and IV must be references to the `Array` type.
// Here we use the `Into` trait to convert arrays into it.
Expand Down
4 changes: 2 additions & 2 deletions rabbit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use hex_literal::hex;

let key = [0x42; 16];
let nonce = [0x24; 8];
let plaintext = hex!("00010203 04050607 08090A0B 0C0D0E0F");
let ciphertext = hex!("10298496 ceda18ee 0e257cbb 1ab43bcc");
let plaintext = hex!("000102030405060708090A0B0C0D0E0F");
let ciphertext = hex!("10298496ceda18ee0e257cbb1ab43bcc");

// Key and IV must be references to the `Array` type.
// Here we use the `Into` trait to convert arrays into it.
Expand Down
4 changes: 2 additions & 2 deletions rabbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub type Iv = cipher::Iv<RabbitCore>;

type BlockSize = U16;

/// The Rabbit stream cipher initializied only with key.
/// The Rabbit stream cipher initialized only with key.
pub type RabbitKeyOnly = StreamCipherCoreWrapper<RabbitKeyOnlyCore>;
/// The Rabbit stream cipher initializied with key and IV.
/// The Rabbit stream cipher initialized with key and IV.
pub type Rabbit = StreamCipherCoreWrapper<RabbitCore>;

/// RFC 4503. 2.2. Inner State (page 2).
Expand Down
15 changes: 6 additions & 9 deletions rc4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,20 @@ use rc4::{consts::*, KeyInit, StreamCipher};
use rc4::{Key, Rc4};

let mut rc4 = Rc4::<U3>::new(b"Key".into());
let mut data = b"Plaintext".to_vec();
let mut data = *b"Plaintext";
rc4.apply_keystream(&mut data);
assert_eq!(data, [0xBB, 0xF3, 0x16, 0xE8, 0xD9, 0x40, 0xAF, 0x0A, 0xD3]);
assert_eq!(data, hex!("BBF316E8D940AF0AD3"));

let mut rc4 = Rc4::<U4>::new(b"Wiki".into());
let mut data = b"pedia".to_vec();
let mut data = *b"pedia";
rc4.apply_keystream(&mut data);
assert_eq!(data, [0x10, 0x21, 0xBF, 0x04, 0x20]);
assert_eq!(data, hex!("1021BF0420"));

let key = Key::<U6>::from_slice(b"Secret");
let mut rc4 = Rc4::<_>::new(key);
let mut data = b"Attack at dawn".to_vec();
let mut data = *b"Attack at dawn";
rc4.apply_keystream(&mut data);
assert_eq!(
data,
[0x45, 0xA0, 0x1F, 0x64, 0x5F, 0xC3, 0x5B, 0x38, 0x35, 0x52, 0x54, 0x4B, 0x9B, 0xF5]
);
assert_eq!(data, hex!("45A01F645FC35B383552544B9BF5"));
```

## License
Expand Down
4 changes: 2 additions & 2 deletions salsa20/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use hex_literal::hex;

let key = [0x42; 32];
let nonce = [0x24; 8];
let plaintext = hex!("00010203 04050607 08090A0B 0C0D0E0F");
let ciphertext = hex!("85843cc5 d58cce7b 5dd3dd04 fa005ded");
let plaintext = hex!("000102030405060708090A0B0C0D0E0F");
let ciphertext = hex!("85843cc5d58cce7b5dd3dd04fa005ded");

// Key and IV must be references to the `Array` type.
// Here we use the `Into` trait to convert arrays into it.
Expand Down
Loading