/* ====================================================================
- * Copyright (c) 2003 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
extern "C" {
#endif
+#ifndef OPENSSL_FIPSCANISTER
+#define OPENSSL_FIPSCAPABLE
+#endif
+
struct dsa_st;
struct ec_key_st;
struct rsa_st;
struct evp_pkey_st;
struct env_md_st;
+struct env_md_ctx_st;
struct evp_cipher_st;
struct evp_cipher_ctx_st;
const unsigned char *ciphertext,
int len);
+const struct env_md_st *FIPS_get_digestbynid(int nid);
+
+struct rsa_st *FIPS_rsa_new(void);
+void FIPS_rsa_free(struct rsa_st *r);
+int FIPS_rsa_sign_ctx(struct rsa_st *rsa, struct env_md_ctx_st *ctx,
+ int rsa_pad_mode, int saltlen,
+ const struct env_md_st *mgf1Hash,
+ unsigned char *sigret, unsigned int *siglen);
+int FIPS_rsa_sign_digest(struct rsa_st *rsa,
+ const unsigned char *md, int md_len,
+ const struct env_md_st *mhash,
+ int rsa_pad_mode, int saltlen,
+ const struct env_md_st *mgf1Hash,
+ unsigned char *sigret, unsigned int *siglen);
+int FIPS_rsa_verify_ctx(struct rsa_st *rsa, struct env_md_ctx_st *ctx,
+ int rsa_pad_mode, int saltlen,
+ const struct env_md_st *mgf1Hash,
+ const unsigned char *sigbuf, unsigned int siglen);
+int FIPS_rsa_verify_digest(struct rsa_st *rsa,
+ const unsigned char *dig, int diglen,
+ const struct env_md_st *mhash,
+ int rsa_pad_mode, int saltlen,
+ const struct env_md_st *mgf1Hash,
+ const unsigned char *sigbuf, unsigned int siglen);
+
#ifndef OPENSSL_FIPSCANISTER
+int FIPS_digestinit(EVP_MD_CTX *ctx, const EVP_MD *type);
+int FIPS_digestupdate(EVP_MD_CTX *ctx, const void *data, size_t count);
+int FIPS_digestfinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size);
+int FIPS_md_ctx_cleanup(EVP_MD_CTX *ctx);
+
+int FIPS_cipherinit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv, int enc);
+int FIPS_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl);
+int FIPS_cipher_ctx_cleanup(EVP_CIPHER_CTX *c);
+
const EVP_CIPHER *FIPS_evp_aes_128_cbc(void);
const EVP_CIPHER *FIPS_evp_aes_128_ccm(void);
const EVP_CIPHER *FIPS_evp_aes_128_cfb1(void);
const EVP_MD *FIPS_evp_sha256(void);
const EVP_MD *FIPS_evp_sha384(void);
const EVP_MD *FIPS_evp_sha512(void);
+const EVP_MD *FIPS_evp_dss1(void);
+const EVP_MD *FIPS_evp_dss(void);
+const EVP_MD *FIPS_evp_ecdsa(void);
+
+const RSA_METHOD *FIPS_rsa_pkcs1_ssleay(void);
+int FIPS_rsa_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
#endif