OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Typedefs | Functions
ec_asn1.c File Reference
#include <string.h>
#include "ec_lcl.h"
#include <openssl/err.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>

Go to the source code of this file.

Classes

struct  x9_62_pentanomial_st
 
struct  x9_62_characteristic_two_st
 
struct  x9_62_fieldid_st
 
struct  x9_62_curve_st
 
struct  ec_parameters_st
 
struct  ecpk_parameters_st
 
struct  ec_privatekey_st
 

Typedefs

typedef struct x9_62_pentanomial_st X9_62_PENTANOMIAL
 
typedef struct
x9_62_characteristic_two_st 
X9_62_CHARACTERISTIC_TWO
 
typedef struct x9_62_fieldid_st X9_62_FIELDID
 
typedef struct x9_62_curve_st X9_62_CURVE
 
typedef struct ec_parameters_st ECPARAMETERS
 
typedef struct ec_privatekey_st EC_PRIVATEKEY
 

Functions

int EC_GROUP_get_basis_type (const EC_GROUP *group)
 
int EC_GROUP_get_trinomial_basis (const EC_GROUP *group, unsigned int *k)
 
int EC_GROUP_get_pentanomial_basis (const EC_GROUP *group, unsigned int *k1, unsigned int *k2, unsigned int *k3)
 
 ASN1_SEQUENCE (X9_62_PENTANOMIAL)
 
 ASN1_ADB (X9_62_CHARACTERISTIC_TWO)
 
 ASN1_SEQUENCE (X9_62_CHARACTERISTIC_TWO)
 
 ASN1_ADB (X9_62_FIELDID)
 
 ASN1_SEQUENCE (X9_62_FIELDID)
 
EC_GROUPd2i_ECPKParameters (EC_GROUP **a, const unsigned char **in, long len)
 
int i2d_ECPKParameters (const EC_GROUP *a, unsigned char **out)
 
EC_KEYd2i_ECPrivateKey (EC_KEY **a, const unsigned char **in, long len)
 
int i2d_ECPrivateKey (EC_KEY *a, unsigned char **out)
 
int i2d_ECParameters (EC_KEY *a, unsigned char **out)
 
EC_KEYd2i_ECParameters (EC_KEY **a, const unsigned char **in, long len)
 
EC_KEYo2i_ECPublicKey (EC_KEY **a, const unsigned char **in, long len)
 
int i2o_ECPublicKey (EC_KEY *a, unsigned char **out)
 

Typedef Documentation

typedef struct x9_62_curve_st X9_62_CURVE

Function Documentation

ASN1_SEQUENCE ( X9_62_PENTANOMIAL  )
ASN1_SEQUENCE ( X9_62_CHARACTERISTIC_TWO  )
ASN1_SEQUENCE ( X9_62_FIELDID  )
EC_KEY* d2i_ECParameters ( EC_KEY **  key,
const unsigned char **  in,
long  len 
)

Decodes ec parameter from a memory buffer.

Parameters
keya pointer to a EC_KEY object which should be used (or NULL)
inpointer to memory with the DER encoded ec parameters
lenlength of the DER encoded ec parameters
Returns
a EC_KEY object with the decoded parameters or NULL if an error occurred.

Definition at line 1344 of file ec_asn1.c.

EC_GROUP* d2i_ECPKParameters ( EC_GROUP **  a,
const unsigned char **  in,
long  len 
)

Definition at line 1066 of file ec_asn1.c.

EC_KEY* d2i_ECPrivateKey ( EC_KEY **  key,
const unsigned char **  in,
long  len 
)

Decodes a private key from a memory buffer.

Parameters
keya pointer to a EC_KEY object which should be used (or NULL)
inpointer to memory with the DER encoded private key
lenlength of the DER encoded private key
Returns
the decoded private key or NULL if an error occurred.

Definition at line 1116 of file ec_asn1.c.

int EC_GROUP_get_basis_type ( const EC_GROUP group)

Definition at line 66 of file ec_asn1.c.

int EC_GROUP_get_pentanomial_basis ( const EC_GROUP group,
unsigned int *  k1,
unsigned int *  k2,
unsigned int *  k3 
)

Definition at line 104 of file ec_asn1.c.

int EC_GROUP_get_trinomial_basis ( const EC_GROUP group,
unsigned int *  k 
)

Definition at line 87 of file ec_asn1.c.

int i2d_ECParameters ( EC_KEY key,
unsigned char **  out 
)

Encodes ec parameter and stores the result in a buffer.

Parameters
keythe EC_KEY object with ec paramters to encode
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred.

Definition at line 1334 of file ec_asn1.c.

int i2d_ECPKParameters ( const EC_GROUP a,
unsigned char **  out 
)

Definition at line 1095 of file ec_asn1.c.

int i2d_ECPrivateKey ( EC_KEY key,
unsigned char **  out 
)

Encodes a private key object and stores the result in a buffer.

Parameters
keythe EC_KEY object to encode
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred.

Definition at line 1224 of file ec_asn1.c.

int i2o_ECPublicKey ( EC_KEY key,
unsigned char **  out 
)

Encodes a ec public key in an octet string.

Parameters
keythe EC_KEY object with the public key
outthe buffer for the result (if NULL the function returns number of bytes needed).
Returns
1 on success and 0 if an error occurred

Definition at line 1405 of file ec_asn1.c.

EC_KEY* o2i_ECPublicKey ( EC_KEY **  key,
const unsigned char **  in,
long  len 
)

Decodes a ec public key from a octet string.

Parameters
keya pointer to a EC_KEY object which should be used
inmemory buffer with the encoded public key
lenlength of the encoded public key
Returns
EC_KEY object with decoded public key or NULL if an error occurred.

Definition at line 1376 of file ec_asn1.c.