From 9723b3213549de9dd414c356caf5bf86f954b367 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 28 Mar 2023 00:16:17 +0200 Subject: [PATCH] mpc: add MerkleTree::commit_id --- commit_verify/src/mpc/tree.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/commit_verify/src/mpc/tree.rs b/commit_verify/src/mpc/tree.rs index aee36cd8..974d65fb 100644 --- a/commit_verify/src/mpc/tree.rs +++ b/commit_verify/src/mpc/tree.rs @@ -27,8 +27,8 @@ use amplify::Wrapper; pub use self::commit::Error; use crate::merkle::{MerkleLeaves, MerkleNode}; use crate::mpc::atoms::Leaf; -use crate::mpc::{Message, MessageMap, Proof, ProtocolId, LNPBP4_TAG}; -use crate::{Conceal, LIB_NAME_COMMIT_VERIFY}; +use crate::mpc::{Commitment, Message, MessageMap, Proof, ProtocolId, LNPBP4_TAG}; +use crate::{strategies, CommitStrategy, CommitmentId, Conceal, LIB_NAME_COMMIT_VERIFY}; type OrderedMap = SmallOrdMap; @@ -51,6 +51,15 @@ pub struct MerkleTree { impl Proof for MerkleTree {} +impl CommitStrategy for MerkleTree { + type Strategy = strategies::ConcealStrict; +} + +impl CommitmentId for MerkleTree { + const TAG: [u8; 32] = *b"urn:lnpbp:lnpbp0004:tree:v01#23A"; + type Id = Commitment; +} + pub struct IntoIter { width: u16, pos: u16,