public interface MerkleTreeHash
JCA-free and lightweight-crypto-free. Concrete SHA-256 bindings:
org.bouncycastle.cert.plants.bc.BcSha256MerkleTreeHash (lightweight)
and org.bouncycastle.cert.plants.jcajce.JcaSha256MerkleTreeHash (JCA).
| Modifier and Type | Method and Description |
|---|---|
org.bouncycastle.asn1.x509.AlgorithmIdentifier |
getAlgorithmIdentifier() |
int |
getHashSize() |
byte[] |
hashLeaf(byte[] entry)
Hash of a leaf entry: HASH(0x00 || entry).
|
byte[] |
hashNode(byte[] left,
byte[] right)
Hash of an internal node: HASH(0x01 || left || right).
|
byte[] |
hashRaw(byte[] data)
Raw hash with no domain separation prefix: HASH(data).
|
org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
AlgorithmIdentifier that names this hash
function. Used by MerkleTreeCertificateValidator to
cross-check the supplied hash against the logHash field
of the CA's id-pe-mtcCertificationAuthority extension.int getHashSize()
byte[] hashLeaf(byte[] entry)
entry - the raw entry bytesbyte[] hashNode(byte[] left,
byte[] right)
left - left child hashright - right child hashbyte[] hashRaw(byte[] data)
data - the input bytes