Registry / crypto / chmike-cmac-go

chmike-cmac-go

JSON →
library1.1.0gogounverified

Implements the Cipher-based Message Authentication Code (CMAC) as defined in RFC4493 and NIST SP 800-38B.

go get github.com/chmike/cmac-go
INSTALL
IMPORT
SIG · CHMIKE-CMAC-GO
C
chmike-cmac-go
cryptogov1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cmac
github.com/chmike/cmac-go

Computes an AES-CMAC for a message

package main import ( "crypto/aes" "fmt" "github.com/chmike/cmac-go" ) func main() { block, _ := aes.NewCipher([]byte("0123456789abcdef")) mac := cmac.New(block) mac.Write([]byte("message")) fmt.Printf("%x", mac.Sum(nil)) }
Debug
Known issues
gotchaUse cmac.Equal for constant-time comparison to avoid timing side-channels.
fix
Replace mac.Sum(nil) comparison with cmac.Equal(mac1, mac2).
affects: all
Upgrade
Version history
1.1.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
Amazon
1
Resources
chmike-cmac-go — go get chmike-cmac-go · libregistry