ccm

package
v0.0.0-...-3fc07a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCCMWithNonceAndTagSizes

func NewCCMWithNonceAndTagSizes(c cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error)

NewCCMWithNonceAndTagSizes returns the given 128-bit, block cipher wrapped in Counter with CBC-MAC Mode, which accepts nonces of the given length. the formatting of this function is defined in SP800-38C, Appendix A. Each arguments have own valid range:

nonceSize should be one of the {7, 8, 9, 10, 11, 12, 13}.
tagSize should be one of the {4, 6, 8, 10, 12, 14, 16}.
Otherwise, it panics.

The maximum payload size is defined as 1<<uint((15-nonceSize)*8)-1. If the given payload size exceeds the limit, it returns a error (Seal returns nil instead). The payload size is defined as len(plaintext) on Seal, len(ciphertext)-tagSize on Open.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL