Update draft-irtf-cfrg-curves-11 references to RFC 7748.

Change-Id: I6148df93a1748754ee6be9e2b98cc8afd38746cb
Reviewed-on: https://boringssl-review.googlesource.com/6960
Reviewed-by: Adam Langley <alangley@gmail.com>
This commit is contained in:
David Benjamin 2016-01-23 01:04:15 -05:00 committed by Adam Langley
parent 4f6acaf0da
commit 415564fe2c
3 changed files with 5 additions and 9 deletions

View File

@ -20,8 +20,7 @@
static bool TestX25519() {
/* Taken from
* https://tools.ietf.org/html/draft-irtf-cfrg-curves-11#section-5.2 */
/* Taken from https://tools.ietf.org/html/rfc7748#section-5.2 */
static const uint8_t kScalar1[32] = {
0xa5, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d, 0x3b, 0x16, 0x15,
0x4b, 0x82, 0x46, 0x5e, 0xdd, 0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc,
@ -91,8 +90,7 @@ static bool TestX25519SmallOrder() {
}
static bool TestX25519Iterated() {
/* Taken from
* https://tools.ietf.org/html/draft-irtf-cfrg-curves-11#section-5.2 */
/* Taken from https://tools.ietf.org/html/rfc7748#section-5.2 */
uint8_t scalar[32] = {9}, point[32] = {9}, out[32];
unsigned i;

View File

@ -24,8 +24,7 @@ extern "C" {
/* Curve25519.
*
* Curve25519 is an elliptic curve. See
* https://tools.ietf.org/html/draft-irtf-cfrg-curves-11. */
* Curve25519 is an elliptic curve. See https://tools.ietf.org/html/rfc7748. */
/* X25519.
@ -33,7 +32,7 @@ extern "C" {
* Curve25519 is an elliptic curve. The same name is also sometimes used for
* the Diffie-Hellman primitive built from it but X25519 is a more precise
* name for that, which is the one used here. See http://cr.yp.to/ecdh.html and
* https://tools.ietf.org/html/draft-irtf-cfrg-curves-11. */
* https://tools.ietf.org/html/rfc7748. */
/* X25519_keypair sets |out_public_value| and |out_private_key| to a freshly
* generated, publicprivate key pair. */

View File

@ -312,8 +312,7 @@ func (e *x25519ECDHCurve) computeSecret(peerKey []byte) (preMasterSecret []byte,
copy(peerKeyCopy[:], peerKey)
curve25519.ScalarMult(&out, &e.privateKey, &peerKeyCopy)
// Per draft-irtf-cfrg-curves-11, reject the all-zero value in constant
// time.
// Per RFC 7748, reject the all-zero value in constant time.
var zeros [32]byte
if subtle.ConstantTimeCompare(zeros[:], out[:]) == 1 {
return nil, errors.New("tls: X25519 value with wrong order")