diff options
author | Pauli <paul.dale@oracle.com> | 2020-09-30 15:07:24 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-10-06 09:04:19 +1000 |
commit | 5357c10624bedaeed984ef4ff370096911ee2ddf (patch) | |
tree | 9b8481eaf37bc1fdef4a90d1300f027e3edcb3a7 /include | |
parent | 69340cafb4a894c469a392ce517b2e092758f1c4 (diff) |
ffc: add _ossl to exported but internal functions
The functions updated are:
ffc_generate_private_key, ffc_named_group_from_uid,
ffc_named_group_to_uid, ffc_params_FIPS186_2_gen_verify,
ffc_params_FIPS186_2_generate, ffc_params_FIPS186_2_validate,
ffc_params_FIPS186_4_gen_verify, ffc_params_FIPS186_4_generate,
ffc_params_FIPS186_4_validate, ffc_params_cleanup, ffc_params_cmp,
ffc_params_copy, ffc_params_enable_flags, ffc_params_flags_from_name,
ffc_params_flags_to_name, ffc_params_fromdata,
ffc_params_get0_pqg, ffc_params_get_validate_params,
ffc_params_init, ffc_params_print, ffc_params_set0_j,
ffc_params_set0_pqg, ffc_params_set_flags, ffc_params_set_gindex,
ffc_params_set_h, ffc_params_set_pcounter, ffc_params_set_seed,
ffc_params_set_validate_params, ffc_params_simple_validate,
ffc_params_todata, ffc_params_validate_unverifiable_g, ffc_set_digest,
ffc_set_group_pqg, ffc_validate_private_key, ffc_validate_public_key
and ffc_validate_public_key_partial.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13041)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/ffc.h | 146 |
1 files changed, 77 insertions, 69 deletions
diff --git a/include/internal/ffc.h b/include/internal/ffc.h index 3a4dcc9dcb..37ebbb5c8e 100644 --- a/include/internal/ffc.h +++ b/include/internal/ffc.h @@ -27,7 +27,7 @@ /* * The mode used by functions that share code for both generation and - * verification. See ffc_params_FIPS186_4_gen_verify(). + * verification. See ossl_ffc_params_FIPS186_4_gen_verify(). */ #define FFC_PARAM_MODE_VERIFY 0 #define FFC_PARAM_MODE_GENERATE 1 @@ -113,78 +113,86 @@ typedef struct ffc_params_st { const char *mdprops; } FFC_PARAMS; -void ffc_params_init(FFC_PARAMS *params); -void ffc_params_cleanup(FFC_PARAMS *params); -void ffc_params_set0_pqg(FFC_PARAMS *params, BIGNUM *p, BIGNUM *q, BIGNUM *g); -void ffc_params_get0_pqg(const FFC_PARAMS *params, const BIGNUM **p, - const BIGNUM **q, const BIGNUM **g); -void ffc_params_set0_j(FFC_PARAMS *d, BIGNUM *j); -int ffc_params_set_seed(FFC_PARAMS *params, - const unsigned char *seed, size_t seedlen); -void ffc_params_set_gindex(FFC_PARAMS *params, int index); -void ffc_params_set_pcounter(FFC_PARAMS *params, int index); -void ffc_params_set_h(FFC_PARAMS *params, int index); -void ffc_params_set_flags(FFC_PARAMS *params, unsigned int flags); -void ffc_params_enable_flags(FFC_PARAMS *params, unsigned int flags, int enable); -int ffc_set_digest(FFC_PARAMS *params, const char *alg, const char *props); - -int ffc_params_set_validate_params(FFC_PARAMS *params, - const unsigned char *seed, size_t seedlen, - int counter); -void ffc_params_get_validate_params(const FFC_PARAMS *params, - unsigned char **seed, size_t *seedlen, - int *pcounter); - -int ffc_params_copy(FFC_PARAMS *dst, const FFC_PARAMS *src); -int ffc_params_cmp(const FFC_PARAMS *a, const FFC_PARAMS *b, int ignore_q); +void ossl_ffc_params_init(FFC_PARAMS *params); +void ossl_ffc_params_cleanup(FFC_PARAMS *params); +void ossl_ffc_params_set0_pqg(FFC_PARAMS *params, BIGNUM *p, BIGNUM *q, + BIGNUM *g); +void ossl_ffc_params_get0_pqg(const FFC_PARAMS *params, const BIGNUM **p, + const BIGNUM **q, const BIGNUM **g); +void ossl_ffc_params_set0_j(FFC_PARAMS *d, BIGNUM *j); +int ossl_ffc_params_set_seed(FFC_PARAMS *params, + const unsigned char *seed, size_t seedlen); +void ossl_ffc_params_set_gindex(FFC_PARAMS *params, int index); +void ossl_ffc_params_set_pcounter(FFC_PARAMS *params, int index); +void ossl_ffc_params_set_h(FFC_PARAMS *params, int index); +void ossl_ffc_params_set_flags(FFC_PARAMS *params, unsigned int flags); +void ossl_ffc_params_enable_flags(FFC_PARAMS *params, unsigned int flags, + int enable); +int ossl_ffc_set_digest(FFC_PARAMS *params, const char *alg, const char *props); + +int ossl_ffc_params_set_validate_params(FFC_PARAMS *params, + const unsigned char *seed, + size_t seedlen, int counter); +void ossl_ffc_params_get_validate_params(const FFC_PARAMS *params, + unsigned char **seed, size_t *seedlen, + int *pcounter); + +int ossl_ffc_params_copy(FFC_PARAMS *dst, const FFC_PARAMS *src); +int ossl_ffc_params_cmp(const FFC_PARAMS *a, const FFC_PARAMS *b, int ignore_q); #ifndef FIPS_MODULE -int ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent); +int ossl_ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent); #endif /* FIPS_MODULE */ -int ffc_params_FIPS186_4_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params, - int type, size_t L, size_t N, - int *res, BN_GENCB *cb); -int ffc_params_FIPS186_2_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params, - int type, size_t L, size_t N, - int *res, BN_GENCB *cb); - -int ffc_params_FIPS186_4_gen_verify(OPENSSL_CTX *libctx, FFC_PARAMS *params, - int mode, int type, size_t L, size_t N, - int *res, BN_GENCB *cb); -int ffc_params_FIPS186_2_gen_verify(OPENSSL_CTX *libctx, FFC_PARAMS *params, - int mode, int type, size_t L, size_t N, - int *res, BN_GENCB *cb); - -int ffc_params_simple_validate(OPENSSL_CTX *libctx, FFC_PARAMS *params, int type); -int ffc_params_FIPS186_4_validate(OPENSSL_CTX *libctx, const FFC_PARAMS *params, - int type, int *res, BN_GENCB *cb); -int ffc_params_FIPS186_2_validate(OPENSSL_CTX *libctx, const FFC_PARAMS *params, - int type, int *res, BN_GENCB *cb); - -int ffc_generate_private_key(BN_CTX *ctx, const FFC_PARAMS *params, - int N, int s, BIGNUM *priv); - -int ffc_params_validate_unverifiable_g(BN_CTX *ctx, BN_MONT_CTX *mont, - const BIGNUM *p, const BIGNUM *q, - const BIGNUM *g, BIGNUM *tmp, int *ret); - -int ffc_validate_public_key(const FFC_PARAMS *params, const BIGNUM *pub_key, - int *ret); -int ffc_validate_public_key_partial(const FFC_PARAMS *params, - const BIGNUM *pub_key, int *ret); -int ffc_validate_private_key(const BIGNUM *upper, const BIGNUM *priv_key, - int *ret); - -int ffc_params_todata(const FFC_PARAMS *ffc, OSSL_PARAM_BLD *tmpl, - OSSL_PARAM params[]); -int ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[]); -int ffc_set_group_pqg(FFC_PARAMS *ffc, const char *group_name); -int ffc_named_group_to_uid(const char *name); -const char *ffc_named_group_from_uid(int nid); -int ffc_set_group_pqg(FFC_PARAMS *ffc, const char *group_name); -const char *ffc_params_flags_to_name(int flags); -int ffc_params_flags_from_name(const char *name); +int ossl_ffc_params_FIPS186_4_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params, + int type, size_t L, size_t N, + int *res, BN_GENCB *cb); +int ossl_ffc_params_FIPS186_2_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params, + int type, size_t L, size_t N, + int *res, BN_GENCB *cb); + +int ossl_ffc_params_FIPS186_4_gen_verify(OPENSSL_CTX *libctx, + FFC_PARAMS *params, int mode, int type, + size_t L, size_t N, int *res, + BN_GENCB *cb); +int ossl_ffc_params_FIPS186_2_gen_verify(OPENSSL_CTX *libctx, + FFC_PARAMS *params, int mode, int type, + size_t L, size_t N, int *res, + BN_GENCB *cb); + +int ossl_ffc_params_simple_validate(OPENSSL_CTX *libctx, FFC_PARAMS *params, + int type); +int ossl_ffc_params_FIPS186_4_validate(OPENSSL_CTX *libctx, + const FFC_PARAMS *params, + int type, int *res, BN_GENCB *cb); +int ossl_ffc_params_FIPS186_2_validate(OPENSSL_CTX *libctx, + const FFC_PARAMS *params, + int type, int *res, BN_GENCB *cb); + +int ossl_ffc_generate_private_key(BN_CTX *ctx, const FFC_PARAMS *params, + int N, int s, BIGNUM *priv); + +int ossl_ffc_params_validate_unverifiable_g(BN_CTX *ctx, BN_MONT_CTX *mont, + const BIGNUM *p, const BIGNUM *q, + const BIGNUM *g, BIGNUM *tmp, + int *ret); + +int ossl_ffc_validate_public_key(const FFC_PARAMS *params, + const BIGNUM *pub_key, int *ret); +int ossl_ffc_validate_public_key_partial(const FFC_PARAMS *params, + const BIGNUM *pub_key, int *ret); +int ossl_ffc_validate_private_key(const BIGNUM *upper, const BIGNUM *priv_key, + int *ret); + +int ossl_ffc_params_todata(const FFC_PARAMS *ffc, OSSL_PARAM_BLD *tmpl, + OSSL_PARAM params[]); +int ossl_ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[]); +int ossl_ffc_set_group_pqg(FFC_PARAMS *ffc, const char *group_name); +int ossl_ffc_named_group_to_uid(const char *name); +const char *ossl_ffc_named_group_from_uid(int nid); +int ossl_ffc_set_group_pqg(FFC_PARAMS *ffc, const char *group_name); +const char *ossl_ffc_params_flags_to_name(int flags); +int ossl_ffc_params_flags_from_name(const char *name); #endif /* OSSL_INTERNAL_FFC_H */ |