package host import "encoding/json" func proofFileSource(file proofUnitFile) []byte { if file.Persistent.Boot != "" { stable := file.Persistent stable.Boot, stable.Device, stable.Mount, stable.MountNamespace = "", 0, 0, "" stable.MountUnique, stable.NamespaceUnique = 0, 0 raw, _ := json.Marshal(struct { Path string Stable any }{file.Path, stable}) return raw } raw, _ := json.Marshal(file.Identity) return raw } func sameProofFiles(prior, current []proofUnitFile) bool { if len(prior) != len(current) { return false } for i, p := range prior { q := current[i] if p.Path != q.Path { return false } if p.Persistent.Boot != "" { if !p.Persistent.Same(q.Persistent) { return false } } else if p.Identity != q.Identity || q.Persistent.Boot != "" { return false } } return true }