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


3907
3908
# File 'Monkeybrains.rb', line 3907

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


3930
3931
# File 'Monkeybrains.rb', line 3930

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


3920
3921
# File 'Monkeybrains.rb', line 3920

def update(message)
end