forked from TrueCloudLab/frostfs-s3-gw
[#539] Fix nonce size computation
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
35f55c5af5
commit
e84ff96593
1 changed files with 1 additions and 1 deletions
|
@ -271,7 +271,7 @@ func encrypt(owner *keys.PrivateKey, sender *keys.PublicKey, data []byte) ([]byt
|
|||
return nil, fmt.Errorf("get chiper: %w", err)
|
||||
}
|
||||
|
||||
nonce := make([]byte, enc.NonceSize(), enc.NonceSize()+len(data)+enc.Overhead())
|
||||
nonce := make([]byte, enc.NonceSize())
|
||||
if _, err = rand.Read(nonce); err != nil {
|
||||
return nil, fmt.Errorf("generate random nonce: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue