corda / net.corda.core.crypto / DigestService / componentHash

componentHash

fun componentHash(opaqueBytes: OpaqueBytes, privacySalt: PrivacySalt, componentGroupIndex: Int, internalIndex: Int): SecureHash

Compute the hash of each serialised component so as to be used as Merkle tree leaf. The resultant output (leaf) is calculated using the service's hash algorithm, thus HASH(HASH(nonce || serializedComponent)) for SHA2-256 and other algorithms loaded via JCA MessageDigest, or DigestAlgorithm.componentDigest(nonce || serializedComponent) otherwise, where nonce is computed from computeNonce.

fun componentHash(nonce: SecureHash, opaqueBytes: OpaqueBytes): SecureHash

Return the HASH(HASH(nonce || serializedComponent)) for SHA2-256 and other algorithms loaded via JCA MessageDigest, otherwise it's defined by DigestAlgorithm.componentDigest(nonce || serializedComponent).