Class: Toybox.Cryptography.CipherBasedMessageAuthenticationCode

Overview

Cipher-Based Message Authentication Code (CMAC) object.

A CipherBasedMessageAuthenticationCode is an object that can be used to compute a message authentication code using the CMAC algorithm.

See Also:

Since:

API Level 3.0.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

digest() as Lang.ByteArray

Return the digest of the authentication code.

The state of the object is reset and can be used to compute a new authentication code with the same options.

Returns:

  • Lang.ByteArray

    The computed message authentication code in network byte order

Since:

API Level 3.0.0

initialize(options as { :algorithm as Cryptography.CipherAlgorithm, :key as Lang.ByteArray })

Constructor

Parameters:

  • options(Lang.Dictionary)

    A Dictionary of options

    • :algorithm(Cryptography.CipherAlgorithm)

      A CIPHER_* value specifying the encryption algorithm used for this CMAC computation; CIPHER_AES128 is the only supported algorithm in Connect IQ 3.x. (required)

    • :key(Lang.ByteArray)

      The secret key used by selected cipher algorithm, which must be the appropriate length for chosen encryption type (required)

Since:

API Level 3.0.0

Throws:

update(message as Lang.ByteArray) as Void

Continue the computation of the CMAC by consuming the next chunk of data.

Repeated calls are equivalent to a single call with the concatenation of all the arguments.

Parameters:

  • message(Lang.ByteArray)

    The next chunk of the message being hashed

Since:

API Level 3.0.0

Throws:


Generated Sep 23, 2024, 3:32:48 PM