NAME
Crypt::OpenSSL::EC - Perl extension for OpenSSL EC (Elliptic Curves) library
SYNOPSIS
use Crypt::OpenSSL::EC;use Crypt::OpenSSL::Bignum::CTX;# Use of $ctx is optional in all calls, here we demonstrate its use.# If it is provided it will increase performance.my $ctx = Crypt::OpenSSL::Bignum::CTX->new();my $method = Crypt::OpenSSL::EC::EC_GFp_mont_method();my $group = Crypt::OpenSSL::EC::EC_GROUP::new($method);Crypt::OpenSSL::EC::EC_GROUP::set_curve_GFp($group, $p, $a, $b, $ctx);my $method = Crypt::OpenSSL::EC::EC_GROUP::method_of($group);Crypt::OpenSSL::EC::EC_GROUP::copy($tmp, $group);Crypt::OpenSSL::EC::EC_GROUP::get_curve_GFp($group, $p, $a, $b, $ctx);$Crypt::OpenSSL::EC::trace = 1;Crypt::OpenSSL::EC::print_errs();my $P = Crypt::OpenSSL::EC::EC_POINT::new($group);Crypt::OpenSSL::EC::EC_POINT_set_to_infinity($group, $P);my $bool = Crypt::OpenSSL::EC::EC_POINT::is_at_infinity($group, $P);my $buf = Crypt::OpenSSL::EC::EC_POINT::point2oct($group, $Q, &Crypt::OpenSSL::EC::POINT_CONVERSION_COMPRESSED, $ctx);Crypt::OpenSSL::EC::EC_POINT::oct2point($group, $P, $buf, $ctx);Crypt::OpenSSL::EC::EC_POINT::add($group, $P, $P, $Q, $ctx);Crypt::OpenSSL::EC::EC_POINT::set_compressed_coordinates_GFp($group, $Q, $x, 1, $ctx));my $bool = Crypt::OpenSSL::EC::EC_POINT::is_on_curve($group, $Q, $ctx));Crypt::OpenSSL::EC::EC_POINT::copy($R, $P);my $result = Crypt::OpenSSL::EC::EC_POINT::cmp($group, $P, $Q, $ctx);Crypt::OpenSSL::EC::EC_POINT::set_affine_coordinates_GFp($group, $P, $x, $y, $ctx);Crypt::OpenSSL::EC::EC_POINT::get_affine_coordinates_GFp($group, $P, $x, $y, $ctx);Crypt::OpenSSL::EC::EC_GROUP::set_generator($group, $P, $z, Crypt::OpenSSL::Bignum->one());my $degree = Crypt::OpenSSL::EC::EC_GROUP::get_degree($group)my $order = Crypt::OpenSSL::EC::EC_GROUP::get_order($group, $order, $ctx);Crypt::OpenSSL::EC::EC_POINT::mul($group, $Q, $order, $P, $n1, $ctx));Crypt::OpenSSL::EC::EC_POINT::free($P);Crypt::OpenSSL::EC::EC_GROUP::free($group);
DESCRIPTION
This module provides a standard (non-OO) interface to the OpenSSL EC (Elliptic Curve) library. Some OO Calls are supported.
Most of the functions described in openssl/ec.h are supported.
It provides the Crypt::OpenSSL::EC class which defines some high level functions and constants. At also provides 4 other classes for managing EC objects:
- Crypt::OpenSSL::EC::EC_GROUP
- Crypt::OpenSSL::EC::EC_POINT
- Crypt::OpenSSL::EC::EC_KEY
- Crypt::OpenSSL::EC::EC_METHOD
All objects created by these 4 classes are implemented as blessed Perl mortal references. This ensures they will be auto-destroyed when the Perl variable becomes unreferenced. ASlo the approproae EC free function wil be called to free the underlying EC object.
Further, it means that many of the functions below can be called using O-O methods. If a method's first argument is the same as the class the method is in, then it can be called O-O style. For example the following 2 calls are equivalent:
- my $newgroup = Crypt::OpenSSL::EC::EC_GROUP::dup($group);
- my $newgroup = $group->dup();
- Crypt::OpenSSL::EC::EC_GFp_simple_method();
-
Returns the basic GFp ec methods which provides the basis for the optimized methods.
- Crypt::OpenSSL::EC::EC_GFp_mont_method();
-
Returns GFp methods using montgomery multiplication.
- Crypt::OpenSSL::EC::EC_GFp_nist_method();
-
Returns GFp methods using optimized methods for NIST recommended curves
- Crypt::OpenSSL::EC::EC_GF2m_simple_method();
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Returns the basic GF2m ec method
- Crypt::OpenSSL::EC::EC_GROUP::new($method);
-
Creates a new EC_GROUP object
$methodis the method to use
- Crypt::OpenSSL::EC::EC_GROUP::set_curve_GFp($group, $p, $a, $b, $ctx);
-
Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b
group EC_GROUP object
p BIGNUM with the prime number
a BIGNUM with parameter a of the equation
b BIGNUM with parameter b of the equation
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::method_of($group);
-
Returns the EC_METHOD of the EC_GROUP object.
- Crypt::OpenSSL::EC::EC_METHOD::get_field_type($method)
-
Returns the field type of the EC_METHOD.
- Crypt::OpenSSL::EC::EC_GROUP::copy($dst, $src);
-
Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. return newly created EC_GROUP object or NULL in case of an error.
- Crypt::OpenSSL::EC::EC_GROUP::dup($src);
-
Creates a new EC_GROUP object and copies the copies the content form src to the newly created EC_GROUP object. return newly created EC_GROUP object or NULL in case of an error.
- Crypt::OpenSSL::EC::EC_GROUP::get_curve_GFp($group, $p, $a, $b, $ctx);
-
Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b
group EC_GROUP object
p BIGNUM for the prime number
a BIGNUM for parameter a of the equation
b BIGNUM for parameter b of the equation
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::set_curve_GF2m($group, $p, $a, $b, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
group EC_GROUP object
p BIGNUM with the polynomial defining the underlying field
a BIGNUM with parameter a of the equation
b BIGNUM with parameter b of the equation
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::get_curve_GF2m($group, $p, $a, $b, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
group EC_GROUP object
p BIGNUM for the polynomial defining the underlying field
a BIGNUM for parameter a of the equation
b BIGNUM for parameter b of the equation
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::print_errs();
- Crypt::OpenSSL::EC::EC_POINT::new($group);
-
Creates a new EC_POINT object for the specified EC_GROUP
group EC_GROUP the underlying EC_GROUP object
return newly created EC_POINT object or NULL if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::free($point);
-
Frees a EC_POINT object
point EC_POINT object to be freed This should normally not be called from Perl, since EC_POINT objects created by this library are auto-destroyed when they become unreferenced.
- Crypt::OpenSSL::EC::EC_POINT::clear_free($point);
-
Clears and frees a EC_POINT object
point EC_POINT object to be cleared and freed This should normally not be called from Perl, since EC_POINT objects created by this library are auto-destroyed when they become unreferenced.
- Crypt::OpenSSL::EC::EC_POINT::copy($dst, $src);
-
Copies EC_POINT object
dst destination EC_POINT object
src source EC_POINT object
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::dup($src, $group);
-
Creates a new EC_POINT object and copies the content of the supplied EC_POINT
src source EC_POINT object
group underlying the EC_GROUP object
return newly created EC_POINT object or NULL if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::set_to_infinity($group, $point);
-
Sets a point to infinity (neutral element)
group underlying EC_GROUP object
point EC_POINT to set to infinity
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::get_Jprojective_coordinates_GFp($group, $p, $x, $y, $z, $ctx);
-
Gets the jacobian projective coordinates of a EC_POINT over GFp
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM for the x-coordinate
y BIGNUM for the y-coordinate
z BIGNUM for the z-coordinate
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::set_affine_coordinates_GFp($group, $p, $x, $y, $ctx);
-
Sets the affine coordinates of a EC_POINT over GFp
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM with the x-coordinate
y BIGNUM with the y-coordinate
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::get_affine_coordinates_GFp($group, $p, $x, $y, $ctx);
-
Gets the affine coordinates of a EC_POINT over GFp
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM for the x-coordinate
y BIGNUM for the y-coordinate
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::set_compressed_coordinates_GFp($group, $p, $x, $y_bit, $ctx);
-
Sets the x9.62 compressed coordinates of a EC_POINT over GFp
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM with x-coordinate
y_bit integer with the y-Bit (either 0 or 1)
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::set_affine_coordinates_GF2m($group, $p, $x, $y, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Sets the affine coordinates of a EC_POINT over GF2m
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM with the x-coordinate
y BIGNUM with the y-coordinate
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::get_affine_coordinates_GF2m($group, $p, $x, $y, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Gets the affine coordinates of a EC_POINT over GF2m
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM for the x-coordinate
y BIGNUM for the y-coordinate
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::set_compressed_coordinates_GF2m($group, $p, $x, $y_bit, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
group underlying EC_GROUP object
p EC_POINT object
x BIGNUM with x-coordinate
y_bit integer with the y-Bit (either 0 or 1)
ctx BN_CTX object (optional)
\return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::is_at_infinity($group, $p);
-
Checks whether the point is the neutral element of the group
group the underlying EC_GROUP object
p EC_POINT object
return 1 if the point is the neutral element and 0 otherwise
- Crypt::OpenSSL::EC::EC_POINT::point2oct($group, $p, $form, $ctx);
-
Encodes a EC_POINT object to a octet string
group underlying EC_GROUP object
p EC_POINT object
form point conversion form
ctx BN_CTX object (optional)
return the encoded EC point
- Crypt::OpenSSL::EC::EC_POINT::oct2point($group, $p, $buf, $ctx);
-
Decodes a EC_POINT from a octet string
group underlying EC_GROUP object
p EC_POINT object
buf buffer with the encoded ec point
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::point2bn($group, $p, $form, $bn, $ctx);
- Crypt::OpenSSL::EC::EC_POINT::bn2point($group, $bn, $p, $ctx);
- Crypt::OpenSSL::EC::EC_POINT::point2hex($group, $p, $form, $bn, $ctx);
- Crypt::OpenSSL::EC::EC_POINT::hex2point($group, $bn, $p, $ctx);
- Crypt::OpenSSL::EC::EC_POINT::add($group, $r, $a, $b, $ctx);
-
Computes the sum of two EC_POINTgroup underlying EC_GROUP objectr EC_POINT object for the result (r = a + b)a EC_POINT object with the first summandb EC_POINT object with the second summandctx BN_CTX object (optional)return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::dbl($group, $r, $a, $ctx);
-
Computes the double of a EC_POINT
group underlying EC_GROUP object
r EC_POINT object for the result (r = 2 * a)
a EC_POINT object
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::invert($group, $a, $ctx);
-
Computes the inverse of a EC_POINT
group underlying EC_GROUP object
a EC_POINT object to be inverted (it's used for the result as well)
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_POINT::is_on_curve($group, $point, $ctx));
-
Checks whether the point is on the curve
group underlying EC_GROUP object
point EC_POINT object to check
ctx BN_CTX object (optional)
return 1 if point if on the curve and 0 otherwise
- Crypt::OpenSSL::EC::EC_POINT::cmp($group, $a, $b, $ctx);
-
Compares two EC_POINTs
group underlying EC_GROUP object
a first EC_POINT object
b second EC_POINT object
ctx BN_CTX object (optional)
return 0 if both points are equal and a value != 0 otherwise
- Crypt::OpenSSL::EC::EC_POINT::make_affine($group, $point, $ct);
- Crypt::OpenSSL::EC::EC_POINTs::make_affine
-
Not Implemented
- Crypt::OpenSSL::EC::EC_POINTs::mul
-
Not Implemented
- Crypt::OpenSSL::EC::EC_GROUP::set_generator($group, $generator, $order, $cofactor);
-
Sets the generator and it's order/cofactor of a EC_GROUP object.
group EC_GROUP object
generator EC_POINT object with the generator.
order the order of the group generated by the generator.
cofactor the index of the sub-group generated by the generator
in the group of all points on the elliptic curve.
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::get0_generator($group);
-
Returns the generator of a EC_GROUP object.
group EC_GROUP objectreturn the currently used generator (possibly NULL).
- Crypt::OpenSSL::EC::EC_GROUP::get_degree($group)
-
Returns the number of bits needed to represent a field element
group EC_GROUP object
return number of bits needed to represent a field element
- Crypt::OpenSSL::EC::EC_GROUP::check($group, $ctx);
-
Checks whether the parameter in the EC_GROUP define a valid ec group
group EC_GROUP object
ctx BN_CTX object (optional)
return 1 if group is a valid ec group and 0 otherwise
- Crypt::OpenSSL::EC::EC_GROUP::check_discriminant($group, $ctx);
-
Checks whether the discriminant of the elliptic curve is zero or not
group EC_GROUP object
ctx BN_CTX object (optional)
return 1 if the discriminant is not zero and 0 otherwise
- Crypt::OpenSSL::EC:: EC_GROUP::cmp($a, $b, $ctx);
-
Compares two EC_GROUP objects
a first EC_GROUP object
b second EC_GROUP object
ctx BN_CTX object (optional)
return 0 if both groups are equal and 1 otherwise
- Crypt::OpenSSL::EC::EC::EC_GROUP::new_curve_GFp($p, $a, $b, $ctx);
-
Creates a new EC_GROUP object with the specified parameters defined over GFp (defined by the equation y^2 = x^3 + a*x + b)
p BIGNUM with the prime number
a BIGNUM with the parameter a of the equation
b BIGNUM with the parameter b of the equation
ctx BN_CTX object (optional)
return newly created EC_GROUP object with the specified parameters
- Crypt::OpenSSL::EC::EC_GROUP::new_curve_GF2m($p, $a, $b, $ctx);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
Creates a new EC_GROUP object with the specified parameters defined over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
p BIGNUM with the polynomial defining the underlying field
a BIGNUM with the parameter a of the equation
b BIGNUM with the parameter b of the equation
ctx BN_CTX object (optional)
return newly created EC_GROUP object with the specified parameters
- Crypt::OpenSSL::EC::EC_GROUP::new_by_curve_name($nid);
-
Creates a EC_GROUP object with a curve specified by a NID
nid NID of the OID of the curve name
return newly created EC_GROUP object with specified curve or NULL
if an error occurred
- Crypt::OpenSSL::EC::EC_get_builtin_curves($r, $nitems);
-
EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all available curves or zero if a error occurred. In case r ist not zero nitems EC_builtin_curve structures are filled with the data of the first nitems internal groups
- Crypt::OpenSSL::EC::EC_GROUP::get_order($group, $order, $ctx);
-
Gets the order of a EC_GROUP
group EC_GROUP objectorder BIGNUM to which the order is copiedctx BN_CTX object (optional)return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::get_cofactor($group, $cofactopr, $ctx)
-
Gets the cofactor of a EC_GROUP
group EC_GROUP objectcofactor BIGNUM to which the cofactor is copiedctx BN_CTX object (optional)return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::set_curve_name($group, $nid);
-
Sets the name of a EC_GROUP object
group EC_GROUP object
nid NID of the curve name OID
- Crypt::OpenSSL::EC::EC_GROUP::get_curve_name($group);
-
Returns the curve name of a EC_GROUP object
group EC_GROUP object
return NID of the curve name OID or 0 if not set.
- Crypt::OpenSSL::EC::EC_GROUP::set_asn1_flag($group, $flag);
-
Sets the ASN flag for the group
- Crypt::OpenSSL::EC::EC_GROUP::get_asn1_flag($group);
-
Returns the ASN flag for the group
- Crypt::OpenSSL::EC::EC_GROUP::set_point_conversion_form($group, $form);
-
Sets the point conversion form.
- Crypt::OpenSSL::EC::EC_GROUP::get_point_conversion_form($group);
-
Returns the point conversion for for the group
- Crypt::OpenSSL::EC::EC_GROUP::get0_seed($group);
-
Returns the 0 seed
- Crypt::OpenSSL::EC::EC_GROUP::get_seed_len($group);
-
Returns the seed length
- Crypt::OpenSSL::EC::EC_GROUP::set_seed($group, $seed);
-
Sets the group seed
- Crypt::OpenSSL::EC::EC_POINT::mul($group, $r, $n, $q, $m, $ctx));
-
Computes r = generator * n + q * m
group underlying EC_GROUP object
r EC_POINT object for the result
n BIGNUM with the multiplier for the group generator (optional)
q EC_POINT object with the first factor of the second summand
m BIGNUM with the second factor of the second summand
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::precompute_mult($group, $ctx);
-
Stores multiples of generator for faster point multiplication
group EC_GROUP object
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred
- Crypt::OpenSSL::EC::EC_GROUP::have_precompute_mult($group);
-
Reports whether a precomputation has been done
group EC_GROUP object
return 1 if a pre-computation has been done and 0 otherwise
- Crypt::OpenSSL::EC::EC_GROUP::get_basis_type($group);
-
EC_GROUP_get_basis_type() returns the NID of the basis type used to represent the field elements
- Crypt::OpenSSL::EC::EC_GROUP::get_trinomial_basis($group, $k);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
- Crypt::OpenSSL::EC:: EC_GROUP::get_pentanomial_basis($group, $k1, $k2, $k3);
-
Not available if OPENSSL_NO_EC2M is defined in OpenSSL.
- Crypt::OpenSSL::EC::EC_GROUP::free($group);
-
Frees a EC_GROUP object. This should normally not be called from Perl, since EC_GROUP objects created by this library are auto-destroyed when they become unreferenced.
- Crypt::OpenSSL::EC::EC_GROUP::clear_free($group);
-
Clears and frees a EC_GROUP object This should normally not be called from Perl, since EC_GROUP objects created by this library are auto-destroyed when they become unreferenced.
- Crypt::OpenSSL::EC::EC_KEY::new(); Creates a new EC_KEY object. return EC_KEY object or NULL if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::new_by_curve_name($nid);
-
Creates a new EC_KEY object using a named curve as underlying EC_GROUP object.
nid NID of the named curve.
return EC_KEY object or NULL if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::free($key);
-
Frees a EC_KEY object.
key EC_KEY object to be freed. This should normally not be called from Perl, since EC_KEY objects created by this library are auto-destroyed when they become unreferenced.
- Crypt::OpenSSL::EC::EC_KEY::copy($dst, $src);
-
Copies a EC_KEY object.
dst destination EC_KEY object
src src EC_KEY object
return dst or NULL if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::dup($src);
-
Creates a new EC_KEY object and copies the content from src to it.
src the source EC_KEY object
return newly created EC_KEY object or NULL if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::up_ref($key);
-
Increases the internal reference count of a EC_KEY object.
key EC_KEY object
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::get0_group($key);
-
Returns the EC_GROUP object of a EC_KEY object
key EC_KEY object
\return the EC_GROUP object (possibly NULL).
- Crypt::OpenSSL::EC::EC_KEY::set_group($key, $group);
-
Sets the EC_GROUP of a EC_KEY object.
key EC_KEY object
group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
object will use an own copy of the EC_GROUP).
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::set_private_key($key, $prv);
-
Sets the private key of a EC_KEY object.
key EC_KEY object
prv BIGNUM with the private key (note: the EC_KEY object
will use an own copy of the BIGNUM).
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::get0_public_key($key);
-
Returns the public key of a EC_KEY object.
key the EC_KEY object
return a EC_POINT object with the public key (possibly NULL)
- Crypt::OpenSSL::EC::EC_KEY::set_public_key($key, $pub);
-
Sets the public key of a EC_KEY object.
key EC_KEY object
pub EC_POINT object with the public key (note: the EC_KEY object
will use an own copy of the EC_POINT object).
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::get_enc_flags($key);
- Crypt::OpenSSL::EC::EC_KEY::set_enc_flags($key, $flags);
- Crypt::OpenSSL::EC::EC_KEY::get_conv_form($key)
- Crypt::OpenSSL::EC::EC_KEY::set_conv_form($key, $form);
- Crypt::OpenSSL::EC::EC_KEY::get_key_method_data
-
Not Implemented
- Crypt::OpenSSL::EC::EC_KEY::insert_key_method_data
-
Not Implemented
- Crypt::OpenSSL::EC::EC_KEY::set_asn1_flag($key, $flag);
- Crypt::OpenSSL::EC::EC_KEY::precompute_mult($key, $ctx);
-
Creates a table of pre-computed multiples of the generator to further EC_KEY operations.
key EC_KEY object
ctx BN_CTX object (optional)
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::generate_key($key);
-
Creates a new ec private (and optional a new public) key.
key EC_KEY object
return 1 on success and 0 if an error occurred.
- Crypt::OpenSSL::EC::EC_KEY::check_key($key);
-
Verifies that a private and/or public key is valid.
key the EC_KEY object
return 1 on success and 0 otherwise.
EXPORT
None by default.
Exportable constants
EC_F_COMPUTE_WNAFEC_F_D2I_ECPARAMETERSEC_F_D2I_ECPKPARAMETERSEC_F_D2I_ECPRIVATEKEYEC_F_DO_EC_KEY_PRINTEC_F_ECKEY_PARAM2TYPEEC_F_ECKEY_PARAM_DECODEEC_F_ECKEY_PRIV_DECODEEC_F_ECKEY_PRIV_ENCODEEC_F_ECKEY_PUB_DECODEEC_F_ECKEY_PUB_ENCODEEC_F_ECKEY_TYPE2PARAMEC_F_ECPARAMETERS_PRINTEC_F_ECPARAMETERS_PRINT_FPEC_F_ECPKPARAMETERS_PRINTEC_F_ECPKPARAMETERS_PRINT_FPEC_F_ECP_NIST_MOD_192EC_F_ECP_NIST_MOD_224EC_F_ECP_NIST_MOD_256EC_F_ECP_NIST_MOD_521EC_F_EC_ASN1_GROUP2CURVEEC_F_EC_ASN1_GROUP2FIELDIDEC_F_EC_ASN1_GROUP2PARAMETERSEC_F_EC_ASN1_GROUP2PKPARAMETERSEC_F_EC_ASN1_PARAMETERS2GROUPEC_F_EC_ASN1_PKPARAMETERS2GROUPEC_F_EC_EX_DATA_SET_DATAEC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLYEC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANTEC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVEEC_F_EC_GF2M_SIMPLE_OCT2POINTEC_F_EC_GF2M_SIMPLE_POINT2OCTEC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATESEC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATESEC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATESEC_F_EC_GFP_MONT_FIELD_DECODEEC_F_EC_GFP_MONT_FIELD_ENCODEEC_F_EC_GFP_MONT_FIELD_MULEC_F_EC_GFP_MONT_FIELD_SET_TO_ONEEC_F_EC_GFP_MONT_FIELD_SQREC_F_EC_GFP_MONT_GROUP_SET_CURVEEC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFPEC_F_EC_GFP_NIST_FIELD_MULEC_F_EC_GFP_NIST_FIELD_SQREC_F_EC_GFP_NIST_GROUP_SET_CURVEEC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANTEC_F_EC_GFP_SIMPLE_GROUP_SET_CURVEEC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFPEC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOREC_F_EC_GFP_SIMPLE_MAKE_AFFINEEC_F_EC_GFP_SIMPLE_OCT2POINTEC_F_EC_GFP_SIMPLE_POINT2OCTEC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINEEC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATESEC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFPEC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATESEC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFPEC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATESEC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFPEC_F_EC_GROUP_CHECKEC_F_EC_GROUP_CHECK_DISCRIMINANTEC_F_EC_GROUP_COPYEC_F_EC_GROUP_GET0_GENERATOREC_F_EC_GROUP_GET_COFACTOREC_F_EC_GROUP_GET_CURVE_GF2MEC_F_EC_GROUP_GET_CURVE_GFPEC_F_EC_GROUP_GET_DEGREEEC_F_EC_GROUP_GET_ORDEREC_F_EC_GROUP_GET_PENTANOMIAL_BASISEC_F_EC_GROUP_GET_TRINOMIAL_BASISEC_F_EC_GROUP_NEWEC_F_EC_GROUP_NEW_BY_CURVE_NAMEEC_F_EC_GROUP_NEW_FROM_DATAEC_F_EC_GROUP_PRECOMPUTE_MULTEC_F_EC_GROUP_SET_CURVE_GF2MEC_F_EC_GROUP_SET_CURVE_GFPEC_F_EC_GROUP_SET_EXTRA_DATAEC_F_EC_GROUP_SET_GENERATOREC_F_EC_KEY_CHECK_KEYEC_F_EC_KEY_COPYEC_F_EC_KEY_GENERATE_KEYEC_F_EC_KEY_NEWEC_F_EC_KEY_PRINTEC_F_EC_KEY_PRINT_FPEC_F_EC_POINTS_MAKE_AFFINEEC_F_EC_POINT_ADDEC_F_EC_POINT_CMPEC_F_EC_POINT_COPYEC_F_EC_POINT_DBLEC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2MgEC_F_EC_POINT_GET_AFFINE_COORDINATES_GFPEC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFPEC_F_EC_POINT_INVERTEC_F_EC_POINT_IS_AT_INFINITYEC_F_EC_POINT_IS_ON_CURVEEC_F_EC_POINT_MAKE_AFFINEEC_F_EC_POINT_MULEC_F_EC_POINT_NEWEC_F_EC_POINT_OCT2POINTEC_F_EC_POINT_POINT2OCTEC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2MEC_F_EC_POINT_SET_AFFINE_COORDINATES_GFPEC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2MEC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFPEC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFPEC_F_EC_POINT_SET_TO_INFINITYEC_F_EC_PRE_COMP_DUPEC_F_EC_PRE_COMP_NEWEC_F_EC_WNAF_MULEC_F_EC_WNAF_PRECOMPUTE_MULTEC_F_I2D_ECPARAMETERSEC_F_I2D_ECPKPARAMETERSEC_F_I2D_ECPRIVATEKEYEC_F_I2O_ECPUBLICKEYEC_F_O2I_ECPUBLICKEYEC_F_OLD_EC_PRIV_DECODEEC_F_PKEY_EC_CTRLEC_F_PKEY_EC_CTRL_STREC_F_PKEY_EC_DERIVEEC_F_PKEY_EC_KEYGENEC_F_PKEY_EC_PARAMGENEC_F_PKEY_EC_SIGNEC_PKEY_NO_PARAMETERSEC_PKEY_NO_PUBKEYEC_R_ASN1_ERROREC_R_ASN1_UNKNOWN_FIELDEC_R_BUFFER_TOO_SMALLEC_R_D2I_ECPKPARAMETERS_FAILUREEC_R_DECODE_ERROREC_R_DISCRIMINANT_IS_ZEROEC_R_EC_GROUP_NEW_BY_NAME_FAILUREEC_R_FIELD_TOO_LARGEEC_R_GROUP2PKPARAMETERS_FAILUREEC_R_I2D_ECPKPARAMETERS_FAILUREEC_R_INCOMPATIBLE_OBJECTSEC_R_INVALID_ARGUMENTEC_R_INVALID_COMPRESSED_POINTEC_R_INVALID_COMPRESSION_BITEC_R_INVALID_CURVEEC_R_INVALID_DIGEST_TYPEEC_R_INVALID_ENCODINGEC_R_INVALID_FIELDEC_R_INVALID_FORMEC_R_INVALID_GROUP_ORDEREC_R_INVALID_PENTANOMIAL_BASISEC_R_INVALID_PRIVATE_KEYEC_R_INVALID_TRINOMIAL_BASISEC_R_KEYS_NOT_SETEC_R_MISSING_PARAMETERSEC_R_MISSING_PRIVATE_KEYEC_R_NOT_A_NIST_PRIMEEC_R_NOT_A_SUPPORTED_NIST_PRIMEEC_R_NOT_IMPLEMENTEDEC_R_NOT_INITIALIZEDEC_R_NO_FIELD_MODEC_R_NO_PARAMETERS_SETEC_R_PASSED_NULL_PARAMETEREC_R_PKPARAMETERS2GROUP_FAILUREEC_R_POINT_AT_INFINITYEC_R_POINT_IS_NOT_ON_CURVEEC_R_SLOT_FULLEC_R_UNDEFINED_GENERATOREC_R_UNDEFINED_ORDEREC_R_UNKNOWN_GROUPEC_R_UNKNOWN_ORDEREC_R_UNSUPPORTED_FIELDEC_R_WRONG_ORDEREVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NIDOPENSSL_ECC_MAX_FIELD_BITSOPENSSL_EC_NAMED_CURVEPOINT_CONVERSION_COMPRESSEDPOINT_CONVERSION_HYBRIDPOINT_CONVERSION_UNCOMPRESSED
SEE ALSO
Crypt::OpenSSL::Bignum
OpenSSL
AUTHOR
Mike McCauley, <[email protected]>
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Mike McCauley
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.