(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.
(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`.
(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.
(hash-node hash-size left right)H(0x01 || left || right)
H(0x01 || left || right)
(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
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |