Verified Commit 867997a2 authored by Katharina Fey's avatar Katharina Fey 🏴
Browse files

Adding some better docs

parent 321b1400
......@@ -47,13 +47,24 @@ mod serial;
use std::fmt;
/// The type of key that should be created
///
/// Each key variant has a number value attached to it which
/// represents the length of the key it represents.
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)]
#[repr(u32)]
pub enum KeyType {
Aes128,
Aes256,
Aes128 = 32,
Aes256 = 64,
}
/// A crytographic key
///
/// Uses a `union` to allow key inlining without heap allocation.
/// Provides easy to use constructors for generation and derivation
/// from user input/name.
///
/// Also implements `serde::{Serialize, Deserialize}` via a custom
/// serialiser which allows easy encryption of the key itself.
pub struct Key {
tt: KeyType,
key: KeyBuf,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment