MCPcopy Index your code
hub / github.com/syncthing/syncthing / decryptDeterministic

Function decryptDeterministic

lib/protocol/encryption.go:469–475  ·  view source on GitHub ↗

decryptDeterministic decrypts bytes using AES-SIV

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

Source from the content-addressed store, hash-verified

467
468// decryptDeterministic decrypts bytes using AES-SIV
469func decryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) ([]byte, error) {
470 aead, err := miscreant.NewAEAD(miscreantAlgo, key[:], 0)
471 if err != nil {
472 panic("cipher failure: " + err.Error())
473 }
474 return aead.Open(nil, nil, data, additionalData)
475}
476
477func encrypt(data []byte, nonce *[nonceSize]byte, key *[keySize]byte) []byte {
478 aead, err := chacha20poly1305.NewX(key[:])

Callers 2

RequestMethod · 0.85
decryptNameFunction · 0.85

Calls 2

ErrorMethod · 0.65
OpenMethod · 0.65

Tested by

no test coverage detected