brownsys/paralegal

Incorporate Hashes for Terminator Dependencies in Attestation Hash

JustusAdam opened this issue · 0 comments

I’ve created the visitor infrastructure to do this. sah::ExternalDependencyHasher is set up (and hooked up) to traverse the body of the slices we create and incorporate both crate-local and external dependencies.

In theory crate-local should work fine (by hashing each dependent MIR body).

The missing piece is incorporation of the external dependencies. I got so far as a to finding the DepGraph data structure, but I am not sure how to get the key for my function to index into it and I also don’t know how to resolve the result to something hashable. There is a SourceFile struct in rustc which is hashable, that could be a solution. Ideally though we can hash dependent items individually though.

I found out that SourceFiles can be found in the SourceMap which is accessible as Session::source_map which is accessible as Queries::session