Documentation ¶
Overview ¶
Package cmac implements the fast CMac MAC based on a block cipher. This mode of operation fixes security deficiencies of CBC-MAC (CBC-MAC is secure only for fixed-length messages). CMac is equal to OMAC1. This implementations supports block ciphers with a block size of:
- 64 bit (8 byte)
- 128 bit (16 byte)
- 256 bit (32 byte)
- 512 bit (64 byte)
- 1024 bit (128 byte)
Common ciphers like AES, Serpent etc. operate on 128 bit blocks. 256, 512 and 1024 are supported for the Threefish tweakable block cipher. Ciphers with 64 bit blocks are supported, but not recommened. CMac (using AES) is specified in RFC 4493.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a hash.Hash computing the CMac checksum. If the block cipher is not supported by CMac (see package doc), a non-nil error is returned.
func Sum ¶
Sum computes the CMac checksum of msg using the cipher.Block. If the block cipher is not supported by CMac (see package doc), a non-nil error is returned.
Types ¶
This section is empty.