From 0fd27eb1560bc5827a554949b3b6683945f58bdc Mon Sep 17 00:00:00 2001 From: lonerapier Date: Sat, 6 Jul 2024 12:22:28 +0530 Subject: [PATCH] fix docs --- src/encryption/symmetric/mod.rs | 3 ++- src/encryption/symmetric/modes/README.md | 5 +++++ src/encryption/symmetric/modes/mod.rs | 1 + src/field/extension/gf_101_2.rs | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/encryption/symmetric/mod.rs b/src/encryption/symmetric/mod.rs index 991791c..781fcee 100644 --- a/src/encryption/symmetric/mod.rs +++ b/src/encryption/symmetric/mod.rs @@ -1,4 +1,5 @@ //! Contains implementation of symmetric encryption primitives. +#![doc = include_str!("./README.md")] pub mod aes; pub mod chacha; pub mod counter; @@ -62,7 +63,7 @@ pub trait BlockCipher { /// Block size in bytes for cipher oprations const BLOCK_SIZE: usize; /// Block acted upon by the cipher - type Block: AsRef<[u8]> + AsMut<[u8]> + From> + Copy; + type Block: AsRef<[u8]> + AsMut<[u8]> + From> + Copy + PartialEq; /// Secret key for encryption/decryption type Key; diff --git a/src/encryption/symmetric/modes/README.md b/src/encryption/symmetric/modes/README.md index 3ff0230..6260a3f 100644 --- a/src/encryption/symmetric/modes/README.md +++ b/src/encryption/symmetric/modes/README.md @@ -35,6 +35,11 @@ IV4["IV||2"]-->Fk2[F_k]-->xor2["⨁"]-->c2 m2-->xor2 ``` +## Next Steps +Implement more modes, and subsequent attacks/vulnerabilities: +- [ ] CFB +- [ ] OFB + ## References - [Understanding Cryptography by Cristof Paar & Jan Pelzl & Tim Güneysu: Chapter 3, 4](https://www.cryptography-textbook.com/) diff --git a/src/encryption/symmetric/modes/mod.rs b/src/encryption/symmetric/modes/mod.rs index 3f586b9..b991fe1 100644 --- a/src/encryption/symmetric/modes/mod.rs +++ b/src/encryption/symmetric/modes/mod.rs @@ -3,5 +3,6 @@ //! - [`cbc::CBC`]: Cipher Block Chaining //! - [`ctr::CTR`]: Counter mode //! - [`gcm::GCM`]: Galois Counter mode +#![doc = include_str!("./README.md")] pub mod cbc; pub mod ctr; diff --git a/src/field/extension/gf_101_2.rs b/src/field/extension/gf_101_2.rs index 981c7da..329d71c 100644 --- a/src/field/extension/gf_101_2.rs +++ b/src/field/extension/gf_101_2.rs @@ -1,7 +1,7 @@ //! This module contains an implementation of the quadratic extension field GF(101^2). //! Elements represented as coefficients of a [`Polynomial`] in the [`Monomial`] basis of degree 1 -//! in form: `a_0 + a_1*t`` where {a_0, a_1} \in \mathhbb{F}. Uses irreducible poly of the form: -//! (X^2-K). +//! in form: `a_0 + a_1*t` where ${a_0, a_1} \in \mathhbb{F}$. Uses irreducible poly of the form: +//! $(X^2-K)$. //! //! The curve used in [`curve::pluto_curve::PlutoBaseCurve`] supports degree two extension field //! [`curve::pluto_curve::PlutoExtendedCurve`] from GF(101) to have points in GF(101^2). This can be