How to incorporate other ECC curves?

151 views
Skip to first unread message

Ron Aaron

unread,
Jan 15, 2016, 2:45:39 AM1/15/16
to LibTom Projects
I'm interested in plugging in other curves, such as Curve25519 and secp256k1, but I can't see any way to do so given the current architecture.  

Any ideas how to approach this?

Ron Aaron

unread,
Jan 22, 2016, 1:00:43 AM1/22/16
to LibTom Projects
Anyone?  I would like to continue to use the tomcrypt framework with newer (or other) ECC curves, just as I can do with regular symmetric ciphers or hashes

tstde...@gmail.com

unread,
Jan 28, 2016, 11:37:12 AM1/28/16
to LibTom Projects
The ideal way is to add the new routines in parallel and then a new PKI api that can talk to them e.g.

int pk_sign_hash(...) that can call ecc_sign_hash or rsa_sign_hash or ...

One issue though is that eddsa signs messages not hashes so the API gets broken so you really need some sort of 

pk_sign_start()
pk_sign_data()
pk_sign_done()

Tom

Ron Aaron

unread,
Mar 20, 2016, 3:02:13 AM3/20/16
to LibTom Projects
Is this something that is on the development schedule?

Karel Miko

unread,
Jun 23, 2016, 4:46:13 PM6/23/16
to LibTom Projects
On Friday, January 15, 2016 at 8:45:39 AM UTC+1, Ron Aaron wrote:
I'm interested in plugging in other curves, such as Curve25519 and secp256k1, but I can't see any way to do so given the current architecture.  



Support for secp256k1 (and others) is already implemented in branch https://github.com/libtom/libtomcrypt/tree/miko-ecc-enhancements - more discussion is here https://github.com/libtom/libtomcrypt/tree/miko-ecc-enhancements

But it is "sleeping" for more than 2 years,

sebasti...@eciotify.io

unread,
Oct 17, 2017, 2:50:29 PM10/17/17
to LibTom Projects
I would be as well interested in an libtomcrypt implementation of secp256k1. Apparently the above links are down. What's the current status of bringing different curves into the API?

Steffen Jaeckel

unread,
Oct 17, 2017, 4:39:56 PM10/17/17
to lib...@googlegroups.com, sebasti...@eciotify.io
We're still working on that.

https://github.com/libtom/libtomcrypt/tree/pr/ecc-asn1-part contains
support for these curves.

On 10/17/2017 08:50 PM, sebasti...@eciotify.io wrote:
> I would be as well interested in an libtomcrypt implementation of secp256k1. Apparently the above links are down. What's the current status of bringing different curves into the API?
>

--
Steffen Jaeckel - s_ja...@gmx.de
GnuPG fingerprint: C438 6A23 7ED4 3A47 5541 B942 7B2C D0DD 4BCF F59B
My OTR key has changed on 30. Sept. 2015!
jabber: jae...@jabber.ccc.de F052DE29 4FA9A02D 44A794E5 AE5AC0FB C5865C64

Karel Miko

unread,
Oct 26, 2017, 3:19:39 AM10/26/17
to LibTom Projects
Just a small correction
* the branch you need is pr/ecc-non-asn1-part
* please note that API might change before we merge this PR to develop

Usage:

int err;
ecc_key key;
const ltc_ecc_set_type* dp;
unsigned char buf[32];
unsigned long len;

/* generate a new key + export the private key to buf[] */
if ((err = ecc_get_set_by_name("SECP256K1", &dp)) != CRYPT_OK) return err;
if ((err = ecc_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key, dp)) != CRYPT_OK) return err;
len = sizeof(buf);
if ((err = ecc_get_key(buf, &len, PK_PRIVATE, &key)) != CRYPT_OK) return err;
ecc_free(&key);

/* load existing private key from buf[] */
if ((err = ecc_get_set_by_name("SECP256K1", &dp)) != CRYPT_OK) return err;
if ((err = ecc_set_dp(dp, &key)) != CRYPT_OK) return err;
if ((err = ecc_set_key(buf, len, PK_PRIVATE, &key)) != CRYPT_OK) return err;
ecc_free(&key);

Reply all
Reply to author
Forward
0 new messages