Supply Chain Integrity, Transparency, and Trust (IETF SCITT)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Promote Irmin.Proof from Private to public API

Irmin.Private.Proof -> Irmin.Proof. The Proof module provides Merkle
proof generation and verification used by SCITT receipt verification.
Security-critical code should not depend on a Private module.

Update ocaml-scitt and scitt-atp to use Irmin.Proof directly.
53/53 scitt tests pass.

+8 -5
+8 -5
lib/scitt.ml
··· 47 47 let vds_registry : (int, vds_info) Hashtbl.t = Hashtbl.create 8 48 48 49 49 let register_hash ?(proof_format = Rfc9162) h = 50 - Hashtbl.replace vds_registry h.id { hash = h; proof_format } 50 + if Hashtbl.mem vds_registry h.id then 51 + invalid_arg 52 + (Fmt.str "Scitt.register_hash: algorithm_id %d already registered" h.id); 53 + Hashtbl.add vds_registry h.id { hash = h; proof_format } 51 54 52 55 let find_hash id = 53 56 Option.map (fun info -> info.hash) (Hashtbl.find_opt vds_registry id) ··· 647 650 (Cbort.Cbor.to_bytes proof_cbor) 648 651 in 649 652 match 650 - Irmin.Private.Proof.decode_cbor 653 + Irmin.Proof.decode_cbor 651 654 ~decode_hash:Atp.Cid.of_raw_bytes 652 655 ~decode_contents:Fun.id irmin_proof_bytes 653 656 with ··· 656 659 (Proof_error ("MST proof decode: " ^ msg)) 657 660 | Ok irmin_proof -> ( 658 661 match 659 - Irmin.Private.Proof.Mst.verify irmin_proof 662 + Irmin.Proof.Mst.verify irmin_proof 660 663 (fun tree -> 661 664 let v = 662 - Irmin.Private.Proof.Mst.Tree.find 663 - tree [ repo_key ] 665 + Irmin.Proof.Mst.Tree.find tree 666 + [ repo_key ] 664 667 in 665 668 (tree, v)) 666 669 with