package conn

Import Path
	google.golang.org/grpc/credentials/alts/internal/conn (on go.dev)

Dependency Relation
	imports 12 packages, and imported by one package

Involved Source Files aeadrekey.go aes128gcm.go aes128gcmrekey.go common.go counter.go Package conn contains an implementation of a secure channel created by gRPC handshakers. utils.go
Package-Level Type Names (total 8, in which 4 are exported)
/* sort exporteds by: | */
ALTSRecordCrypto is the interface for gRPC ALTS record protocol. Decrypt decrypts ciphertext and verify the tag (if any). dst and ciphertext may alias exactly or not at all. To reuse ciphertext's storage for the decrypted output, use ciphertext[:0] as dst. Encrypt encrypts the plaintext and computes the tag (if any) of dst and plaintext. dst and plaintext may fully overlap or not at all. EncryptionOverhead returns the tag size (if any) in bytes. func NewAES128GCM(side core.Side, key []byte) (ALTSRecordCrypto, error) func NewAES128GCMRekey(side core.Side, key []byte) (ALTSRecordCrypto, error)
ALTSRecordFunc is a function type for factory functions that create ALTSRecordCrypto instances. func RegisterProtocol(protocol string, f ALTSRecordFunc) error
Counter is a 96-bit, little-endian counter. Inc increments the counter and checks for overflow. Value returns the current value of the counter as a byte slice. func CounterFromValue(value []byte, overflowLen int) (c Counter) func NewInCounter(s core.Side, overflowLen int) (c Counter) func NewOutCounter(s core.Side, overflowLen int) (c Counter)
KeySizeError signals that the given key does not have the correct size. ( T) Error() string T : error
Package-Level Functions (total 14, in which 10 are exported)
CounterFromValue creates a new counter given an initial value.
CounterSide returns the connection side (client/server) a sequence counter is associated with.
NewAES128GCM creates an instance that uses aes128gcm for ALTS record.
NewAES128GCMRekey creates an instance that uses aes128gcm with rekeying for ALTS record. The key argument should be 44 bytes, the first 32 bytes are used as a key for HKDF-expand and the remainining 12 bytes are used as a random mask for the counter.
NewConn creates a new secure channel instance given the other party role and handshaking result.
NewInCounter returns an incoming counter initialized to the starting sequence number for the client/server side of a connection. This is used in ALTS record to check that incoming counters are as expected, since ALTS record guarantees that messages are unwrapped in the same order that the peer wrapped them.
NewOutCounter returns an outgoing counter initialized to the starting sequence number for the client/server side of a connection.
ParseFramedMsg parse the provided buffer and returns a frame of the format msgLength+msg and any remaining bytes in that buffer.
RegisterProtocol register a ALTS record encryption protocol.
SliceForAppend takes a slice and a requested number of bytes. It returns a slice with the contents of the given slice followed by that many bytes and a second slice that aliases into it and contains only the extra bytes. If the original slice has sufficient capacity then no allocation is performed.
Package-Level Variables (total 3, in which 1 are exported)
ErrAuth occurs on authentication failure.
Package-Level Constants (total 17, in which 2 are exported)
GcmTagSize is the GCM tag size is the difference in length between plaintext and ciphertext. From crypto/cipher/gcm.go in Go crypto library.
MsgLenFieldSize is the byte size of the frame length field of a framed message.