MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / measure_log

Function measure_log

dstack-mr/src/util.rs:27–36  ·  view source on GitHub ↗

Computes a measurement of the given RTMR event log.

(log: &[Vec<u8>])

Source from the content-addressed store, hash-verified

25}
26/// Computes a measurement of the given RTMR event log.
27pub(crate) fn measure_log(log: &[Vec<u8>]) -> Vec<u8> {
28 let mut mr = [0u8; 48]; // SHA384 output size
29 for entry in log {
30 let mut hasher = Sha384::new();
31 hasher.update(mr);
32 hasher.update(entry);
33 mr = hasher.finalize().into();
34 }
35 mr.to_vec()
36}

Callers 2

measure_with_logsMethod · 0.85
rtmr0Method · 0.85

Calls 1

to_vecMethod · 0.80

Tested by

no test coverage detected