Re: [xsl] Merkle Tree Algorithm and SHA-256

Subject: Re: [xsl] Merkle Tree Algorithm and SHA-256
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 6 Jan 2020 10:37:00 -0000
Looking at the code of a Javascript implementation of SHA-256, the algorithm
doesn't look difficult to implement in XPath/XSLT with a little help from the
EXPath/binary module to do the bit-twiddling. But if you're doing it in Saxon,
calling out to the Java implementation that comes with the JDK looks easier
and faster.

Michael Kay
Saxonica

> On 5 Jan 2020, at 18:44, Vasu Chakkera vasucv@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hello All,
> Wish you all a very happy new year..
> I am having to do a Merkle Tree algorithm for doing the checksum of files
when moving files from to AWS from the local network ( on-prem) . I have a
number of solutions for this. Using Java, Node JS etc. While I was
implementing this, I couldn't stop thinking about the similarity of the Merkle
Tree and XML tree and how we can implement this using XSLT. The following is
the representation of Merkle tree
> https://en.wikipedia.org/wiki/Merkle_tree#/media/File:Hash_Tree.svg
<https://en.wikipedia.org/wiki/Merkle_tree#/media/File:Hash_Tree.svg>
>
> My XSLT script in general is ready except for the hash part, and I am not
sure if there is a way to execute SHA-256 on the files using XSLT.  My script
serializes an XML Tree and creates hash attributes for each of the nodes.
>
> If anyone has implemented sha-256 hashing from XSLT, I would like to know.
Alternatively I would have to write something up in Java and call it from
XSLT.
>
> Vasu
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email <>)

Current Thread