MCPcopy
hub / github.com/syncthing/syncthing / encryptBytes

Function encryptBytes

lib/protocol/encryption.go:454–457  ·  view source on GitHub ↗

encryptBytes encrypts bytes with a random nonce

(data []byte, key *[keySize]byte)

Source from the content-addressed store, hash-verified

452
453// encryptBytes encrypts bytes with a random nonce
454func encryptBytes(data []byte, key *[keySize]byte) []byte {
455 nonce := randomNonce()
456 return encrypt(data, nonce, key)
457}
458
459// encryptDeterministic encrypts bytes using AES-SIV
460func encryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) []byte {

Callers 3

TestEnDecryptBytesFunction · 0.85
RequestMethod · 0.85
encryptFileInfoFunction · 0.85

Calls 2

randomNonceFunction · 0.85
encryptFunction · 0.85

Tested by 1

TestEnDecryptBytesFunction · 0.68