A whimsical STROBE based encryption protocol
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Zeroize important stuff

+61 -2
+23
Cargo.lock
··· 39 39 checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 40 40 41 41 [[package]] 42 + name = "hybrid-array" 43 + version = "0.4.10" 44 + source = "registry+https://github.com/rust-lang/crates.io-index" 45 + checksum = "3944cf8cf766b40e2a1a333ee5e9b563f854d5fa49d6a8ca2764e97c6eddb214" 46 + dependencies = [ 47 + "typenum", 48 + ] 49 + 50 + [[package]] 42 51 name = "itoa" 43 52 version = "1.0.18" 44 53 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 52 61 dependencies = [ 53 62 "cfg-if", 54 63 "cpufeatures", 64 + "hybrid-array", 55 65 ] 56 66 57 67 [[package]] ··· 148 158 ] 149 159 150 160 [[package]] 161 + name = "typenum" 162 + version = "1.19.0" 163 + source = "registry+https://github.com/rust-lang/crates.io-index" 164 + checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" 165 + 166 + [[package]] 151 167 name = "unicode-ident" 152 168 version = "1.0.24" 153 169 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 163 179 "serde", 164 180 "serde-big-array", 165 181 "serde_json", 182 + "zeroize", 166 183 ] 184 + 185 + [[package]] 186 + name = "zeroize" 187 + version = "1.8.2" 188 + source = "registry+https://github.com/rust-lang/crates.io-index" 189 + checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" 167 190 168 191 [[package]] 169 192 name = "zmij"
+4
Cargo.toml
··· 6 6 version = "0.1.0" 7 7 edition = "2024" 8 8 9 + [features] 10 + parallel = ["keccak/parallel"] 11 + 9 12 [dependencies] 10 13 keccak = "0.2" 11 14 ctutils = { version = "0.4.2", default-features = false } 15 + zeroize = { version = "1.8.2", default-features = false } 12 16 13 17 [dev-dependencies] 14 18 serde_json = "1"
+6
src/keccakf.rs
··· 12 12 #[repr(align(8))] 13 13 pub(crate) struct KeccakF1600(pub(crate) [u8; KECCAK_BUFFER_SIZE]); 14 14 15 + impl zeroize::Zeroize for KeccakF1600 { 16 + fn zeroize(&mut self) { 17 + self.0.zeroize(); 18 + } 19 + } 20 + 15 21 impl KeccakF1600 { 16 22 fn copy_into(&self, dst: &mut [u64; KECCAK_BLOCK_SIZE]) { 17 23 assert_eq!(self.0.len(), dst.len() * SIZE);
+6
src/opflags.rs
··· 57 57 } 58 58 } 59 59 60 + impl zeroize::Zeroize for OpFlags { 61 + fn zeroize(&mut self) { 62 + self.0.zeroize(); 63 + } 64 + } 65 + 60 66 impl core::fmt::Debug for OpFlags { 61 67 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 62 68 write!(f, "OpFlags({:#08b})", self.0)
+22 -2
src/strobe.rs
··· 1 1 use ctutils::{Choice, CtAssign, CtEq, CtLt, CtSelect}; 2 + use zeroize::Zeroize; 2 3 3 4 use crate::{ 4 5 GarbledError, STROBE_VERSION, ··· 59 60 let more = prev_flags.ct_eq(&flags); 60 61 self.operate(flags, data, more); 61 62 } 62 - )* 63 + )* 63 64 }; 64 65 } 65 66 ··· 75 76 let more = prev_flags.ct_eq(&flags); 76 77 self.operate_no_mutate(flags, data, more); 77 78 } 78 - )* 79 + )* 79 80 }; 81 + } 82 + 83 + impl Zeroize for StrobeState { 84 + fn zeroize(&mut self) { 85 + self.state.zeroize(); 86 + self.rate.zeroize(); 87 + self.position.zeroize(); 88 + self.start.zeroize(); 89 + self.role.zeroize(); 90 + self.prev_flags.zeroize(); 91 + } 92 + } 93 + 94 + impl zeroize::ZeroizeOnDrop for StrobeState {} 95 + 96 + impl Drop for StrobeState { 97 + fn drop(&mut self) { 98 + self.zeroize(); 99 + } 80 100 } 81 101 82 102 impl core::fmt::Display for StrobeState {