HmacSha256

expect object HmacSha256

HMAC-SHA256 message authentication code.

Hash-based Message Authentication Code using SHA-256 as the hash function. Used in NIP-44 for message authentication and key derivation (HKDF).

See also

actual object HmacSha256
actual object HmacSha256

Functions

Link copied to clipboard
expect fun compute(key: ByteArray, message: ByteArray): ByteArray

Computes HMAC-SHA256 of a message.

actual fun compute(key: ByteArray, message: ByteArray): ByteArray
actual fun compute(key: ByteArray, message: ByteArray): ByteArray
Link copied to clipboard
expect fun computeWithAad(key: ByteArray, aad: ByteArray, message: ByteArray): ByteArray

Computes HMAC-SHA256 with additional authenticated data (AAD).

actual fun computeWithAad(key: ByteArray, aad: ByteArray, message: ByteArray): ByteArray
actual fun computeWithAad(key: ByteArray, aad: ByteArray, message: ByteArray): ByteArray
Link copied to clipboard

Compares two byte arrays in constant time to prevent timing attacks.