[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-19-g019e0e9
by NIIBE Yutaka
cvs at cvs.gnupg.org
Sun Jan 12 14:04:24 CET 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
via 019e0e9e8c77a2edf283745e05e9301673ea6a0a (commit)
from 43376891c01f4aff1fbfb23beafebb5adfd0868c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 019e0e9e8c77a2edf283745e05e9301673ea6a0a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Sun Jan 12 21:54:57 2014 +0900
Add secp256k1 curve.
* cipher/ecc-curves.c (curve_aliases): Add secp256k1 and its OID.
(domain_parms): Add secp256k1's domain paramerter.
* tests/basic.c (check_pubkey): Add a key of secp256k1.
* tests/curves.c (N_CURVES): Updated.
--
The key in check_pubkey is from "Test vector 1" of following page.
https://en.bitcoin.it/wiki/BIP_0032_TestVectors
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c
index ed629fc..a4bce67 100644
--- a/cipher/ecc-curves.c
+++ b/cipher/ecc-curves.c
@@ -73,6 +73,8 @@ static const struct
{ "brainpoolP384r1", "1.3.36.3.3.2.8.1.1.11"},
{ "brainpoolP512r1", "1.3.36.3.3.2.8.1.1.13"},
+ { "secp256k1", "1.3.132.0.10" },
+
{ NULL, NULL}
};
@@ -297,6 +299,17 @@ static const ecc_domain_parms_t domain_parms[] =
"c83ab156d77f1496bf7eb3351e1ee4e43dc1a18b91b24640b6dbb92cb1add371e",
},
+ {
+ "secp256k1", 256, 0,
+ MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
+ "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000007",
+ "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
+ "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
+ "0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8"
+ },
+
{ NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL }
};
diff --git a/tests/basic.c b/tests/basic.c
index 0eb8215..56328d1 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -5901,6 +5901,28 @@ check_pubkey (void)
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" }
+ },
+ { /* secp256k1 test 256 bit. */
+ GCRY_PK_ECDSA, FLAG_SIGN,
+ {
+ "(private-key\n"
+ " (ecc\n"
+ " (curve secp256k1)\n"
+ " (q #0439A36013301597DAEF41FBE593A02CC513D0B55527EC2D"
+ " F1050E2E8FF49C85C23CBE7DED0E7CE6A594896B8F62888F"
+ " DBC5C8821305E2EA42BF01E37300116281#)\n"
+ " (d #E8F32E723DECF4051AEFAC8E2C93C9C5B214313817CDB01A"
+ " 1494B917C8436B35#)))\n",
+
+ "(public-key\n"
+ " (ecc\n"
+ " (curve secp256k1)\n"
+ " (q #0439A36013301597DAEF41FBE593A02CC513D0B55527EC2D"
+ " F1050E2E8FF49C85C23CBE7DED0E7CE6A594896B8F62888F"
+ " DBC5C8821305E2EA42BF01E37300116281#)))\n"
+
+ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" }
}
};
int i;
diff --git a/tests/curves.c b/tests/curves.c
index 198693e..04e6bc9 100644
--- a/tests/curves.c
+++ b/tests/curves.c
@@ -29,7 +29,7 @@
#include "../src/gcrypt-int.h"
/* Number of curves defined in ../cipger/ecc.c */
-#define N_CURVES 15
+#define N_CURVES 16
/* A real world sample public key. */
static char const sample_key_1[] =
-----------------------------------------------------------------------
Summary of changes:
cipher/ecc-curves.c | 13 +++++++++++++
tests/basic.c | 22 ++++++++++++++++++++++
tests/curves.c | 2 +-
3 files changed, 36 insertions(+), 1 deletion(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list