#crypto #cyclist #xoodyak #duplex #no-std

no-std cyclist

A generic Rust implementation of the Cyclist mode of permutation-based cryptography (e.g. Xoodyak).

7 releases

Uses new Rust 2021

0.4.0 Sep 16, 2022
0.3.3 Sep 6, 2022
0.3.2 Aug 31, 2022
0.2.0 Aug 12, 2022
0.1.0 May 8, 2022

#462 in Cryptography

Download history 10/week @ 2022-06-07 35/week @ 2022-06-14 38/week @ 2022-06-21 99/week @ 2022-06-28 34/week @ 2022-07-05 32/week @ 2022-07-12 31/week @ 2022-07-19 89/week @ 2022-07-26 60/week @ 2022-08-02 98/week @ 2022-08-09 127/week @ 2022-08-16 58/week @ 2022-08-23 145/week @ 2022-08-30 116/week @ 2022-09-06 99/week @ 2022-09-13 65/week @ 2022-09-20

437 downloads per month

MIT license

33KB
649 lines

cyclist

A Rust implementation of the Cyclist mode of permutation-based cryptography.

Includes Xoodyak and several Keccak-p based constructions (affectionately called Keccyak).

License

Copyright © 2020-2022 Coda Hale, Frank Denis

(Some portions adapted from rust-xoodyak.)

Distributed under the MIT License.


lib.rs:

Cyclist is a mode of operation on top of a full-state keyed duplex construction which provides fine-grained symmetric-key cryptographic services via stateful objects.

Message Digests

use cyclist::Cyclist;
use cyclist::xoodyak::XoodyakHash;

let mut hash = XoodyakHash::default();
hash.absorb(b"This is an input message!");
let digest = hash.squeeze(16);

assert_eq!(digest, vec![24, 79, 57, 49, 133, 57, 228, 222, 11, 95, 145, 57, 76, 16, 16, 122]);

Message Authentication Codes

use cyclist::Cyclist;
use cyclist::xoodyak::XoodyakKeyed;

let mut mac = XoodyakKeyed::new(b"This is a secret key!", None, None);
mac.absorb(b"This is an input message!");
let tag = mac.squeeze(16);

assert_eq!(tag, vec![51, 9, 222, 84, 128, 163, 130, 40, 35, 128, 18, 50, 94, 35, 18, 220]);

Authenticated Encryption And Data

use cyclist::Cyclist;
use cyclist::xoodyak::XoodyakKeyed;

let mut aead = XoodyakKeyed::new(b"This is a secret key!", Some(b"This is a nonce!"), None);
aead.absorb(b"This is authenticated data!");
let ciphertext = aead.seal(b"This is the plaintext!");

assert_eq!(ciphertext, vec![97, 247, 123, 78, 11, 4, 150, 39, 135, 111, 17, 144, 2, 213, 214, 67, 129, 74, 235, 106, 181, 3, 167, 200, 108, 162, 56, 51, 224, 223, 216, 143, 88, 206, 100, 125, 51, 44]);

Dependencies

~140KB