CMac class

CMAC - as specified at www.nuee.nagoya-u.ac.jp/labs/tiwata/omac/omac.html

CMAC is analogous to OMAC1 - see also en.wikipedia.org/wiki/CMAC

CMAC is a NIST recomendation - see csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38B.pdf

CMAC/OMAC1 is a blockcipher-based message authentication code designed and analyzed by Tetsu Iwata and Kaoru Kurosawa.

CMAC/OMAC1 is a simple variant of the CBC MAC (Cipher Block Chaining Message Authentication Code). OMAC stands for One-Key CBC MAC.

It supports 128- or 64-bits block ciphers, with any key size, and returns a MAC with dimension less or equal to the block size of the underlying cipher.

Implemented types

Constructors

CMac(BlockCipher cipher, int macSizeInBits)
create a standard MAC based on a block cipher with the size of the MAC been given in bits.
CMac.fromCipher(BlockCipher cipher)
create a standard MAC based on a CBC block cipher (64 or 128 bit block). This will produce an authentication code the length of the block size of the cipher.

Properties

algorithmName String
Get this algorithm's standard name.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
macSize int
Get this MAC's output size.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

doFinal(Uint8List out, int outOff) int
Store the MAC of previously given data in buffer out starting at offset outOff. This method returns the size of the digest.
override
init(covariant KeyParameter keyParams) → void
Init the MAC with its initialization params. The type of CipherParameters depends on the algorithm being used (see the documentation of each implementation to find out more).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(Uint8List data) Uint8List
Process a whole block of data at once, returning the result in a new byte array.
inherited
reset() → void
Reset the mac generator.
override
toString() String
A string representation of this object.
inherited
update(Uint8List inp, int inOff, int len) → void
Add len bytes of data contained in inp, starting at position inpOff to the MAC'ed input.
override
updateByte(int inp) → void
Add one byte of data to the MAC input.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

factoryConfig → FactoryConfig
final

Static Methods

lookupPoly(int blockSizeLength) Uint8List
shiftLeft(Uint8List block, Uint8List output) int