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

Function empty_payload

nodedb-wal/src/crypto.rs:534–544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

532
533 #[test]
534 fn empty_payload() {
535 let key = test_key();
536 let epoch = *key.epoch();
537 let header = test_header(1);
538
539 let ciphertext = key.encrypt(1, &header, b"").unwrap();
540 assert_eq!(ciphertext.len(), AUTH_TAG_SIZE); // Just the tag.
541
542 let decrypted = key.decrypt(&epoch, 1, &header, &ciphertext).unwrap();
543 assert!(decrypted.is_empty());
544 }
545
546 #[test]
547 fn different_lsns_produce_different_ciphertext() {

Callers

nothing calls this directly

Calls 5

test_headerFunction · 0.85
encryptMethod · 0.80
decryptMethod · 0.80
test_keyFunction · 0.70
epochMethod · 0.45

Tested by

no test coverage detected