MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / hmac_rejects_wrong_key

Function hmac_rejects_wrong_key

nodedb-cluster/src/rpc_codec/mac.rs:131–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130 #[test]
131 fn hmac_rejects_wrong_key() {
132 let k1 = MacKey::from_bytes([1u8; MAC_LEN]);
133 let k2 = MacKey::from_bytes([2u8; MAC_LEN]);
134 let tag = compute_hmac(&k1, b"msg");
135 assert!(verify_hmac(&k2, b"msg", &tag).is_err());
136 }
137
138 #[test]
139 fn debug_redacts_key() {

Callers

nothing calls this directly

Calls 1

compute_hmacFunction · 0.70

Tested by

no test coverage detected