Liking cljdoc? Tell your friends :D

roughtime-protocol.merkle


build-allclj

(build-all leaves {:keys [hash-size tree-order] :as opts})

Constructs the tree once and returns a map containing the root and a vector of paths for all leaves.

Constructs the tree once and returns a map containing the root
and a vector of paths for all leaves.
sourceraw docstring

build-pathclj

(build-path leaves index {:keys [hash-size tree-order] :as opts})

Builds the PATH bytes for leaf at index.

Builds the PATH bytes for leaf at `index`.
sourceraw docstring

compute-rootclj

(compute-root leaves {:keys [hash-size tree-order] :as opts})

Computes the root of a tree given a list of leaf data byte arrays.

Computes the root of a tree given a list of leaf data byte arrays.
sourceraw docstring

hash-leafclj

(hash-leaf hash-size data)

H(0x00 || data)

H(0x00 || data)
sourceraw docstring

hash-nodeclj

(hash-node hash-size left right)

H(0x01 || left || right)

H(0x01 || left || right)
sourceraw docstring

reconstruct-rootclj

(reconstruct-root {:keys [leaf-data path-bytes index]}
                  {:keys [hash-size tree-order]})

Computes the root of a tree given a leaf, index, and path

Computes the root of a tree given a leaf, index, and path
sourceraw docstring

valid-proof?clj

(valid-proof? {:keys [root _path-bytes _index _leaf-data] :as args}
              {:keys [_hash-size _tree-order] :as opts})

Checks the server proof (PATH + INDX + leaf data) against the server ROOT value.

PATH, INDX, and ROOT come from the response; leaf-data must be supplied by the client. Depending on the protocol version, it is either the NONC or the entire request packet, including header and padding bytes.

Checks the server proof (PATH + INDX + leaf data) against the server ROOT value.

PATH, INDX, and ROOT come from the response; `leaf-data` must be supplied by
the client.  Depending on the protocol version, it is either the NONC or the
entire request packet, including header and padding bytes.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close