diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-02-01 18:22:35 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-02-28 22:54:53 +0000 |
commit | 3e8ee4753c78556a83b7bc08d522c08f0d8808c1 (patch) | |
tree | a0416768fc9fb1650d9dfabc06d8e5f1bd07de77 /crypto/ec | |
parent | 6ea04154dc17c37083717d8a8bb86f4bc9f0dee5 (diff) | |
download | openssl-3e8ee4753c78556a83b7bc08d522c08f0d8808c1.zip openssl-3e8ee4753c78556a83b7bc08d522c08f0d8808c1.tar.gz openssl-3e8ee4753c78556a83b7bc08d522c08f0d8808c1.tar.bz2 |
Add custom_data field for EC_POINT, EC_KEY.
In some cases the EC_POINT and EC_KEY BIGNUM components are suboptimal
or inappropriate. Add an "custom_data" field which curves can populate with
a custom structure to suit their needs.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec_lcl.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h index e3b1c5d..742e90a 100644 --- a/crypto/ec/ec_lcl.h +++ b/crypto/ec/ec_lcl.h @@ -297,6 +297,12 @@ struct ec_key_st { EC_GROUP *group; EC_POINT *pub_key; BIGNUM *priv_key; + /* + * Arbitrary extra data. + * For example in X25519 this contains the raw private key in a 32 byte + * buffer. + */ + void *custom_data; unsigned int enc_flag; point_conversion_form_t conv_form; int references; @@ -316,6 +322,11 @@ struct ec_point_st { * Z) represents (X/Z^2, Y/Z^3) if Z != 0 */ int Z_is_one; /* enable optimized point arithmetics for * special case */ + /* + * Arbitrary extra data. + * For example in X25519 this contains the public key in a 32 byte buffer. + */ + void *custom_data; } /* EC_POINT */ ; NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *); |