corda / net.corda.core.crypto / computeNonce

computeNonce

fun computeNonce(privacySalt: PrivacySalt, groupIndex: Int, internalIndex: Int): SHA256

Method to compute a nonce based on privacySalt, component group index and component internal index. SHA256d (double SHA256) is used to prevent length extension attacks.

Parameters

privacySalt - a PrivacySalt.

groupIndex - the fixed index (ordinal) of this component group.

internalIndex - the internal index of this object in its corresponding components list.

Return
SHA256(SHA256(privacySalt || groupIndex || internalIndex))