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 0f6e140
Showing 1 changed file with 2 additions and 2 deletions.
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 0f6e140

Please sign in to comment.