MCPcopy Create free account
hub / github.com/XTLS/Go / aeadAESGCM

Function aeadAESGCM

cipher_suites.go:504–520  ·  view source on GitHub ↗
(key, noncePrefix []byte)

Source from the content-addressed store, hash-verified

502}
503
504func aeadAESGCM(key, noncePrefix []byte) aead {
505 if len(noncePrefix) != noncePrefixLength {
506 panic("tls: internal error: wrong nonce length")
507 }
508 aes, err := aes.NewCipher(key)
509 if err != nil {
510 panic(err)
511 }
512 aead, err := cipher.NewGCM(aes)
513 if err != nil {
514 panic(err)
515 }
516
517 ret := &prefixNonceAEAD{aead: aead}
518 copy(ret.nonce[:], noncePrefix)
519 return ret
520}
521
522func aeadAESGCMTLS13(key, nonceMask []byte) aead {
523 if len(nonceMask) != aeadNonceLength {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…