Updated is my code constant time? (markdown)

Sun Yimin 2022-09-02 11:02:37 +08:00
parent 98329ca0e8
commit 4f97c5c30e

@ -65,7 +65,11 @@ type Curve interface {
// the result is the all-zero value, ECDH returns an error. // the result is the all-zero value, ECDH returns an error.
ECDH(local *PrivateKey, remote *PublicKey) ([]byte, error) ECDH(local *PrivateKey, remote *PublicKey) ([]byte, error)
SM2MQV(sLocal, eLocal *PrivateKey, sRemote, eRemote *PublicKey) (*PublicKey, error) // SM2MQV performs a SM2 specific style ECMQV exchange and return the shared secret.
SM2MQV(sLocal, eLocal *PrivateKey, sRemote, eRemote *PublicKey) (*PublicKey, error)
// SM2SharedKey performs SM2 key derivation to generate shared keying data, the uv was generated by SM2MQV.
SM2SharedKey(isResponder bool, kenLen int, uv, sPub, sRemote *PublicKey, uid []byte, remoteUID []byte) ([]byte, error)
// GenerateKey generates a new PrivateKey from rand. // GenerateKey generates a new PrivateKey from rand.
GenerateKey(rand io.Reader) (*PrivateKey, error) GenerateKey(rand io.Reader) (*PrivateKey, error)