Add X25519 test vectors from RFC7748 6.1
authorDr. Stephen Henson <steve@openssl.org>
Tue, 2 Feb 2016 19:07:18 +0000 (19:07 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 28 Feb 2016 22:54:54 +0000 (22:54 +0000)
Check sign/verify blocked with X25519

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
test/evptests.txt

index c325ac9..4c83163 100644 (file)
@@ -3029,3 +3029,45 @@ SharedSecret=E3CC07DFBDDE76A1139811DB9FF5FAF9D17EF39944F1E77D1F6A208524BF7B1B
 Derive=P-256-Peer
 PeerKey=P-256-PUBLIC
 SharedSecret=E3CC07DFBDDE76A1139811DB9FF5FAF9D17EF39944F1E77D1F6A208524BF7B1B
+
+# X25519 test vectors from RFC7748 6.1
+PrivateKey=Alice-25519
+-----BEGIN PRIVATE KEY-----
+MEICAQAwFAYHKoZIzj0CAQYJKwYBBAHaRw8BBCcwJQIBAQQgdwdtCnMYpX08FsFy
+UbJmRd9ML4frwJkqsXf7pR25LCo=
+-----END PRIVATE KEY-----
+PublicKey=Alice-25519-PUBLIC
+-----BEGIN PUBLIC KEY-----
+MDkwFAYHKoZIzj0CAQYJKwYBBAHaRw8BAyEAhSDwCYkwp1R0i33ctD73Wg2/Og0m
+OBr066SpjqqbTmo=
+-----END PUBLIC KEY-----
+PrivateKey=Bob-25519
+-----BEGIN PRIVATE KEY-----
+MEICAQAwFAYHKoZIzj0CAQYJKwYBBAHaRw8BBCcwJQIBAQQgXasIfmJKikt54X+L
+g4AO5m87sSkmGLb9HC+LJ/+I4Os=
+-----END PRIVATE KEY-----
+PublicKey=Bob-25519-PUBLIC
+-----BEGIN PUBLIC KEY-----
+MDkwFAYHKoZIzj0CAQYJKwYBBAHaRw8BAyEA3p7bfXt9wbTTW2HC7OQ1Nz+DQ8hb
+eGdNrfx+FG+IK08=
+-----END PUBLIC KEY-----
+
+Derive=Alice-25519
+PeerKey=Bob-25519-PUBLIC
+SharedSecret=4A5D9D5BA4CE2DE1728E3BF480350F25E07E21C947D19E3376F09B3C1E161742
+
+Derive=Bob-25519
+PeerKey=Alice-25519-PUBLIC
+SharedSecret=4A5D9D5BA4CE2DE1728E3BF480350F25E07E21C947D19E3376F09B3C1E161742
+# Try to sign/verify using X25519 keys: both return errors.
+Sign = Alice-25519
+Ctrl = digest:SHA256
+Input = "0123456789ABCDEF1234"
+Output = 30
+Result = KEYOP_ERROR
+
+Verify = Alice-25519-PUBLIC
+Ctrl = digest:SHA256
+Input = "0123456789ABCDEF1234"
+Output = 30
+Result = VERIFY_ERROR