MCPcopy Create free account
hub / github.com/RustCrypto/utils / zeroize_bytes

Function zeroize_bytes

zeroize/tests/zeroize.rs:64–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63#[test]
64fn zeroize_bytes() {
65 for len in [0, 1, 15, 16, 17, 31, 32, 33] {
66 let mut bytes = [42u8; 35];
67 zeroize::zeroize_bytes(&mut bytes[1..1 + len]);
68
69 assert_eq!(bytes[0], 42);
70 assert!(bytes[1..1 + len].iter().all(|&byte| byte == 0));
71 assert!(bytes[1 + len..].iter().all(|&byte| byte == 42));
72 }
73}
74
75#[test]
76fn zeroize_on_drop_byte_arrays() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected