mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 08:55:59 +01:00
brontide: properly pack nonce as 96-bit little endian value
This commit is contained in:
parent
fdb111e867
commit
b1d28426d5
1 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ func (c *cipherState) Encrypt(associatedData, cipherText, plainText []byte) []by
|
|||
}()
|
||||
|
||||
var nonce [12]byte
|
||||
binary.LittleEndian.PutUint64(nonce[:], c.nonce)
|
||||
binary.LittleEndian.PutUint64(nonce[4:], c.nonce)
|
||||
|
||||
return c.cipher.Seal(cipherText, nonce[:], plainText, associatedData)
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ func (c *cipherState) Decrypt(associatedData, plainText, cipherText []byte) ([]b
|
|||
}()
|
||||
|
||||
var nonce [12]byte
|
||||
binary.LittleEndian.PutUint64(nonce[:], c.nonce)
|
||||
binary.LittleEndian.PutUint64(nonce[4:], c.nonce)
|
||||
|
||||
return c.cipher.Open(plainText, nonce[:], cipherText, associatedData)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue