Skip to content

Commit

Permalink
go/common/crypto/mrae/deoxysii: Use SHA512/256 for the KDF
Browse files Browse the repository at this point in the history
Following 73aacaa, this should also use
the correct hash algorithm for the KDF.
  • Loading branch information
Yawning committed Apr 17, 2020
1 parent c154e9f commit c6a5d36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .changelog/2853.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
go/common/crypto/mrae/deoxysii: Use SHA512/256 for the KDF

Following 73aacaa73d7116a6be0443e70f2d10d0c7a4b76e, this should also use
the correct hash algorithm for the KDF.
4 changes: 2 additions & 2 deletions go/common/crypto/mrae/deoxysii/asymmetric.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package deoxysii

import (
"crypto/sha256"
"crypto/sha512"

"github.com/oasislabs/deoxysii"
"github.com/oasislabs/oasis-core/go/common/crypto/mrae/api"
Expand All @@ -18,7 +18,7 @@ var (
type boxImpl struct{}

func (impl *boxImpl) DeriveSymmetricKey(key []byte, publicKey, privateKey *[32]byte) {
api.ECDHAndTweak(key, publicKey, privateKey, sha256.New, boxKDFTweak)
api.ECDHAndTweak(key, publicKey, privateKey, sha512.New512_256, boxKDFTweak)
}

func (impl *boxImpl) Seal(dst, nonce, plaintext, additionalData []byte, peersPublicKey, privateKey *[32]byte) []byte {
Expand Down

0 comments on commit c6a5d36

Please sign in to comment.