MCPcopy
hub / github.com/syncthing/syncthing / encryptDeterministic

Function encryptDeterministic

lib/protocol/encryption.go:460–466  ·  view source on GitHub ↗

encryptDeterministic encrypts bytes using AES-SIV

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

Source from the content-addressed store, hash-verified

458
459// encryptDeterministic encrypts bytes using AES-SIV
460func encryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) []byte {
461 aead, err := miscreant.NewAEAD(miscreantAlgo, key[:], 0)
462 if err != nil {
463 panic("cipher failure: " + err.Error())
464 }
465 return aead.Seal(nil, nil, data, additionalData)
466}
467
468// decryptDeterministic decrypts bytes using AES-SIV
469func decryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) ([]byte, error) {

Callers 4

TestKeyDerivationFunction · 0.85
encryptBlockHashFunction · 0.85
encryptNameFunction · 0.85
PasswordTokenFunction · 0.85

Calls 1

ErrorMethod · 0.65

Tested by 1

TestKeyDerivationFunction · 0.68