Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Katharina Fey
keybob
Commits
867997a2
Verified
Commit
867997a2
authored
Jun 25, 2018
by
Katharina Fey
🏴
Browse files
Adding some better docs
parent
321b1400
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib.rs
View file @
867997a2
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment