hide the definition of ECDSA_METHOD and ECDSA_DATA (and mutatis mutandis

for ecdh)
This commit is contained in:
Nils Larsch
2005-04-29 15:56:06 +00:00
parent 7ab2d30349
commit 6a50d0a422
14 changed files with 218 additions and 79 deletions

View File

@@ -75,44 +75,14 @@
extern "C" {
#endif
/* Already defined in ossl_typ.h */
/* typedef struct ecdsa_method ECDSA_METHOD; */
typedef struct ECDSA_SIG_st
{
BIGNUM *r;
BIGNUM *s;
} ECDSA_SIG;
struct ecdsa_method
{
const char *name;
ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len,
EC_KEY *eckey);
int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv,
BIGNUM **r);
int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len,
const ECDSA_SIG *sig, EC_KEY *eckey);
#if 0
int (*init)(EC_KEY *eckey);
int (*finish)(EC_KEY *eckey);
#endif
int flags;
char *app_data;
};
typedef struct ecdsa_data_st {
/* EC_KEY_METH_DATA part */
int (*init)(EC_KEY *);
void (*finish)(EC_KEY *);
/* method (ECDSA) specific part */
BIGNUM *kinv; /* signing pre-calc */
BIGNUM *r; /* signing pre-calc */
ENGINE *engine;
int flags;
const ECDSA_METHOD *meth;
CRYPTO_EX_DATA ex_data;
} ECDSA_DATA;
/* ecdsa_data_st is defined in ecs_locl.h */
typedef struct ecdsa_data_st ECDSA_DATA;
/** ECDSA_SIG *ECDSA_SIG_new(void)
* allocates and initialize a ECDSA_SIG structure
@@ -164,14 +134,6 @@ ECDSA_DATA *ECDSA_DATA_new_method(ENGINE *eng);
*/
void ECDSA_DATA_free(ECDSA_DATA *data);
/** ecdsa_check
* checks whether ECKEY->meth_data is a pointer to a ECDSA_DATA structure
* and if not it removes the old meth_data and creates a ECDSA_DATA structure.
* \param eckey pointer to a EC_KEY object
* \return pointer to a ECDSA_DATA structure
*/
ECDSA_DATA *ecdsa_check(EC_KEY *eckey);
/** ECDSA_do_sign
* computes the ECDSA signature of the given hash value using
* the supplied private key and returns the created signature.