Class: Toybox::Cryptography::CipherBasedMessageAuthenticationCode

Inherits:
Lang::Object
  • Object
show all

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.

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(options) ⇒ CipherBasedMessageAuthenticationCode

Returns a new instance of CipherBasedMessageAuthenticationCode

Parameters:

Options Hash (options):

  • :algorithm (Toybox::Lang::Number)

    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 (Toybox::Lang::ByteArray)

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

Raises:

Since:

  • 3.0.0


4818
4819
# File 'Monkeybrains.rb', line 4818

def initialize(options)
end

Instance Method Details

digestToybox::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:

Since:

  • 3.0.0


4841
4842
# File 'Monkeybrains.rb', line 4841

def digest()
end

update(message) ⇒ Object

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:

Raises:

Since:

  • 3.0.0


4831
4832
# File 'Monkeybrains.rb', line 4831

def update(message)
end