Ejemplo n.º 1
0
 public Root HashTreeRoot(SigningRoot signingRoot)
 {
     return(signingRoot.HashTreeRoot());
     // Merkle.Ize(out UInt256 root, signingRoot);
     // Span<byte> bytes = MemoryMarshal.Cast<UInt256, byte>(MemoryMarshal.CreateSpan(ref root, 1));
     // return new Root(bytes);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Return the signing root of an object by calculating the root of the object-domain tree.
        /// </summary>
        public Root ComputeSigningRoot(Root objectRoot, Domain domain)
        {
            // TODO: Duplicate of BeaconChainUtility

            SigningRoot domainWrappedObject = new SigningRoot(objectRoot, domain);

            return(_cryptographyService.HashTreeRoot(domainWrappedObject));
        }
Ejemplo n.º 3
0
 public Root HashTreeRoot(SigningRoot signingRoot)
 {
     throw new NotImplementedException();
 }
 public Root HashTreeRoot(SigningRoot signingRoot)
 {
     return(signingRoot.HashTreeRoot());
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Return the signing root of an object by calculating the root of the object-domain tree.
        /// </summary>
        public Root ComputeSigningRoot(Root objectRoot, Domain domain)
        {
            SigningRoot domainWrappedObject = new SigningRoot(objectRoot, domain);

            return(_cryptographyService.HashTreeRoot(domainWrappedObject));
        }
Ejemplo n.º 6
0
        private static IEnumerable <SszElement> GetValues(SigningRoot item)
        {
            yield return(item.ObjectRoot.ToSszBasicVector());

            yield return(item.Domain.ToSszBasicVector());
        }
Ejemplo n.º 7
0
        public static Root HashTreeRoot(this SigningRoot item)
        {
            var tree = new SszTree(new SszContainer(GetValues(item)));

            return(new Root(tree.HashTreeRoot()));
        }