Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Aug 16, 2024
1 parent 7e7fd72 commit c6b4c27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cry/enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/komuw/ong/internal/key"

"golang.org/x/crypto/argon2"
"golang.org/x/crypto/chacha20poly1305"
)

Expand Down Expand Up @@ -134,7 +133,7 @@ func (e Enc) Decrypt(encryptedMsg []byte) (decryptedMsg []byte, err error) {
if !slices.Equal(salt, e.salt) {
// The encryptedMsg was encrypted using a different salt.
// So, we need to get the derived key for that salt and use it for decryption.
derivedKey := argon2.IDKey(e.key, salt, time, memory, threads, keyLen)
derivedKey := deriveKey(e.key, salt)

aead, err = chacha20poly1305.NewX(derivedKey)
if err != nil {
Expand Down

0 comments on commit c6b4c27

Please sign in to comment.