Repo of no-std crates for my personal embedded projects
0
fork

Configure Feed

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

BufferSlice reset method

+15 -1
+7 -1
sachy-crypto/Cargo.toml
··· 7 7 version.workspace = true 8 8 rust-version.workspace = true 9 9 10 + [features] 11 + alloc = ["chacha20poly1305/alloc"] 12 + 10 13 [dependencies] 11 - chacha20poly1305 = { version = "=0.11.0-rc.3", default-features = false, features = ["getrandom", "alloc"] } 14 + chacha20poly1305 = { version = "=0.11.0-rc.3", default-features = false, features = ["getrandom"] } 12 15 k256 = { version = "=0.14.0-rc.8", default-features = false, features = ["ecdh", "getrandom"] } 13 16 sha2 = { version = "=0.11.0-rc.5", default-features = false, features = [] } 14 17 dhkem = { version = "0.1.0-rc.0", features = ["getrandom", "k256"] } 15 18 elliptic-curve = { version = "0.14.0-rc.28", default-features = false, features = ["ecdh"] } 19 + 20 + [dev-dependencies] 21 + chacha20poly1305 = { version = "=0.11.0-rc.3", default-features = false, features = ["getrandom", "alloc"] }
+8
sachy-crypto/src/lib.rs
··· 300 300 slice, 301 301 } 302 302 } 303 + 304 + pub fn reset(&mut self) { 305 + self.end = self.slice.len(); 306 + } 303 307 } 304 308 305 309 impl AsRef<[u8]> for BufferSlice<'_> { ··· 356 360 357 361 assert_eq!(buf_slice.extend_from_slice(&[0,0,0,0,0,0]), Ok(())); 358 362 assert_eq!(buf_slice.len(), 70); 363 + 364 + buf_slice.reset(); 365 + 366 + assert_eq!(buf_slice.len(), 128); 359 367 } 360 368 361 369 #[test]