diff options
author | Geoff Thorpe <geoff@openssl.org> | 2004-05-15 18:32:08 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2004-05-15 18:32:08 +0000 |
commit | d6dda126b7921c1067cdc49845e4656c53a5c96b (patch) | |
tree | 56add0d2b707f7697918103d858a5f33eac8f050 /crypto/bn | |
parent | 7771b6c5b5cfeaab5eb0dca6f9ddb1dae0389f2d (diff) |
Make some more API types opaquely available from ossl_typ.h, meaning the
corresponding headers are only required for API functions or structure
details. This now includes the bignum types and BUF_MEM. Subsequent commits
will remove various dependencies on bn.h and buffer.h and update the
makefile dependencies.
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index dac794b600..0f6373aea9 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -76,6 +76,7 @@ #ifndef OPENSSL_NO_FP_API #include <stdio.h> /* FILE */ #endif +#include <openssl/ossl_typ.h> #ifdef __cplusplus extern "C" { @@ -248,10 +249,6 @@ extern "C" { #define BN_DEFAULT_BITS 1280 -#ifdef BIGNUM -#undef BIGNUM -#endif - #define BN_FLG_MALLOCED 0x01 #define BN_FLG_STATIC_DATA 0x02 #ifndef OPENSSL_NO_DEPRECATED @@ -260,7 +257,18 @@ extern "C" { #define BN_set_flags(b,n) ((b)->flags|=(n)) #define BN_get_flags(b,n) ((b)->flags&(n)) -typedef struct bignum_st +/* Already declared in ossl_typ.h */ +#if 0 +typedef struct bignum_st BIGNUM; +/* Used for temp variables (declaration hidden in bn_lcl.h) */ +typedef struct bignum_ctx BN_CTX; +typedef struct bn_blinding_st BN_BLINDING; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct bn_recp_ctx_st BN_RECP_CTX; +typedef struct bn_gencb_st BN_GENCB; +#endif + +struct bignum_st { BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ int top; /* Index of last used d +1. */ @@ -268,12 +276,9 @@ typedef struct bignum_st int dmax; /* Size of the d array. */ int neg; /* one if the number is negative */ int flags; - } BIGNUM; - -/* Used for temp variables (declaration hidden in bn_lcl.h) */ -typedef struct bignum_ctx BN_CTX; + }; -typedef struct bn_blinding_st +struct bn_blinding_st { int init; BIGNUM *A; @@ -281,10 +286,10 @@ typedef struct bn_blinding_st BIGNUM *mod; /* just a reference */ unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b; * used only by crypto/rsa/rsa_eay.c, rsa_lib.c */ - } BN_BLINDING; + }; /* Used for montgomery multiplication */ -typedef struct bn_mont_ctx_st +struct bn_mont_ctx_st { int ri; /* number of bits in R */ BIGNUM RR; /* used to convert to montgomery form */ @@ -293,22 +298,21 @@ typedef struct bn_mont_ctx_st * (Ni is only stored for bignum algorithm) */ BN_ULONG n0; /* least significant word of Ni */ int flags; - } BN_MONT_CTX; + }; /* Used for reciprocal division/mod functions * It cannot be shared between threads */ -typedef struct bn_recp_ctx_st +struct bn_recp_ctx_st { BIGNUM N; /* the divisor */ BIGNUM Nr; /* the reciprocal */ int num_bits; int shift; int flags; - } BN_RECP_CTX; + }; /* Used for slow "generation" functions. */ -typedef struct bn_gencb_st BN_GENCB; struct bn_gencb_st { unsigned int ver; /* To handle binary (in)compatibility */ |