-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub const BLOCK_SIZE: usize = 16; | ||
pub const NONCE_SIZE: usize = 12; | ||
pub const TAG_SIZE: usize = 16; | ||
pub const NONCE_SIZE: usize = BLOCK_SIZE - 4; | ||
pub const TAG_SIZE: usize = BLOCK_SIZE; | ||
pub const C_SIZE: usize = TAG_SIZE; // C for common size, ion mean none else | ||
pub const ZEROED_BLOCK: [u8; C_SIZE] = [0u8; C_SIZE]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
use crate::constants::C_SIZE; | ||
use crate::error::Error; | ||
use anyhow::Result as AnyRes; | ||
|
||
pub type Result<T> = AnyRes<T, Error>; | ||
|
||
pub type Bytes = [u8]; | ||
pub type BlockBytes = [u8; C_SIZE]; | ||
pub type Nonce = Bytes; | ||
pub type Key = Bytes; | ||
pub type CTRInitializer = u32; |