corda / net.corda.core.crypto / DigestAlgorithm

DigestAlgorithm

interface DigestAlgorithm

Interface for injecting custom digest implementation bypassing JCA.

Properties

algorithm

abstract val algorithm: String

Algorithm identifier.

digestLength

abstract val digestLength: Int

The length of the digest in bytes.

Functions

componentDigest

open fun componentDigest(bytes: ByteArray): ByteArray

Computes the digest of the ByteArray which is resistant to pre-image attacks. Only used to calculate the hash of the leaves of the ComponentGroup Merkle tree, starting from its serialized components. Default implementation provides double hashing, but can it be changed to single hashing or something else for better performance.

digest

abstract fun digest(bytes: ByteArray): ByteArray

Computes the digest of the ByteArray.

nonceDigest

open fun nonceDigest(bytes: ByteArray): ByteArray

Computes the digest of the ByteArray which is resistant to pre-image attacks. Only used to calculate the nonces for the leaves of the ComponentGroup Merkle tree. Default implementation provides double hashing, but can it be changed to single hashing or something else for better performance.

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.