Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev/robin/8241 accumulator prove and verify (#22)
COSE Receipt MMRIVER draft alignment changes The primary change here is to make our consistency proofs and inclusion proofs work in terms of the accumulator defined in the paper referenced by the COSE Receipts MMRIVER [draft](https://www.ietf.org/archive/id/draft-bryce-cose-merkle-mountain-range-proofs-00.html). And generaly include full support for [COSE Recieipts](https://cose-wg.github.io/draft-ietf-cose-merkle-tree-proofs/draft-ietf-cose-merkle-tree-proofs.html) It also cleans up various algorithm implementations and checks that the draft algorithm implmentations and our go lang immplementation both meet the test vectors published by the draft. Because it remains useful to be able to do so, I have retained the original variants of algorithms that worked with mmr "bagged" peaks. Some algorithm implementations I think we can remove altogether, but in this pr have not been deleted. Instead they are used in tests which show the "old" versions match the "new" versions So in summary * <file>bagged.go means a file that has things only relevant for MMR bagged peaks * <file>old.go means a file that has things that are retained for compatibility testing but which are now "depricated" * <func>Bagged() means the function is only relevant for working with MMR bagged peaks * <func>Old() means the function is depricated, retained for compatibility testing * clean up proof generation and align with likely rfc alog destription * verification from generic accumulator proof, helpers and tests * simplification for AddHashedLeaf * test: add various tests showing alignment with the mmr draft * fix: log base 2 32 bit variant off by one * Pre-signed receipts attached as seal headers * Add guard to IndexProof where the requested index is greater than the MMRSize limit * mmrIndex vs mmrSize bug in BuildReceipt --------- Signed-off-by: robinbryce <[email protected]> Co-authored-by: Robin Bryce <[email protected]> Co-authored-by: Joe Gough <[email protected]>
- Loading branch information