microsoft / go-crypto-winnative

Go crypto backend for Windows using CNG
MIT License
28 stars 3 forks source link

Update GenerateKeyECDH to return private bytes instead of public ones #33

Closed qmuntal closed 1 year ago

qmuntal commented 1 year ago

I misinterpreted the second return parameter of boring.GenerateKeyECDH. It is meant to contain the private bytes of the key, but we are returning the public bytes. We haven't found this mismatch until now because boring support for ECDH landed just 4 days ago in CL 423363.

This PR updates GenerateKeyECDH so it matches upstream behavior.