MCPcopy
hub / github.com/grpc/grpc-go / Seal

Method Seal

credentials/alts/internal/conn/aeadrekey.go:70–76  ·  view source on GitHub ↗

Seal rekeys if nonce[2:8] is different than in the last call, masks the nonce, and calls Seal for aes128gcm.

(dst, nonce, plaintext, additionalData []byte)

Source from the content-addressed store, hash-verified

68// Seal rekeys if nonce[2:8] is different than in the last call, masks the nonce,
69// and calls Seal for aes128gcm.
70func (s *rekeyAEAD) Seal(dst, nonce, plaintext, additionalData []byte) []byte {
71 if err := s.rekeyIfRequired(nonce); err != nil {
72 panic(fmt.Sprintf("Rekeying failed with: %s", err.Error()))
73 }
74 maskNonce(s.nonceBuf, nonce, s.nonceMask)
75 return s.gcmAEAD.Seal(dst, s.nonceBuf, plaintext, additionalData)
76}
77
78// Open rekeys if nonce[2:8] is different than in the last call, masks the nonce,
79// and calls Open for aes128gcm.

Callers 3

EncryptMethod · 0.80
EncryptMethod · 0.80

Calls 3

rekeyIfRequiredMethod · 0.95
maskNonceFunction · 0.85
ErrorMethod · 0.65

Tested by 1