Remove |EVP_DigestInit| and |EVP_DigestFinal| (dead code).

This commit is contained in:
Brian Smith 2015-10-31 10:09:30 -10:00
parent c8a7001677
commit 6eef3756f6
3 changed files with 2 additions and 22 deletions

View File

@ -114,11 +114,6 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) {
return 1;
}
int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) {
EVP_MD_CTX_init(ctx);
return EVP_DigestInit_ex(ctx, type, NULL);
}
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) {
ctx->digest->update(ctx, data, len);
return 1;
@ -134,12 +129,6 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out, unsigned int *size) {
return 1;
}
int EVP_DigestFinal(EVP_MD_CTX *ctx, uint8_t *md, unsigned int *size) {
(void)EVP_DigestFinal_ex(ctx, md, size);
EVP_MD_CTX_cleanup(ctx);
return 1;
}
int EVP_Digest(const void *data, size_t count, uint8_t *out_md,
unsigned int *out_size, const EVP_MD *type, ENGINE *impl) {
EVP_MD_CTX ctx;

View File

@ -105,10 +105,6 @@ OPENSSL_EXPORT int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
OPENSSL_EXPORT int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type,
ENGINE *engine);
/* EVP_DigestInit acts like |EVP_DigestInit_ex| except that |ctx| is
* initialised before use. */
OPENSSL_EXPORT int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
/* EVP_DigestUpdate hashes |len| bytes from |data| into the hashing operation
* in |ctx|. It returns one. */
OPENSSL_EXPORT int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data,
@ -127,11 +123,6 @@ OPENSSL_EXPORT int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data,
OPENSSL_EXPORT int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out,
unsigned int *out_size);
/* EVP_DigestFinal acts like |EVP_DigestFinal_ex| except that
* |EVP_MD_CTX_cleanup| is called on |ctx| before returning. */
OPENSSL_EXPORT int EVP_DigestFinal(EVP_MD_CTX *ctx, uint8_t *md_out,
unsigned int *out_size);
/* EVP_Digest performs a complete hashing operation in one call. It hashes
* |len| bytes from |data| and writes the digest to |md_out|. At most
* |EVP_MAX_MD_SIZE| bytes are written. If |out_size| is not NULL then

View File

@ -59,7 +59,7 @@ pub struct Context {
impl Context {
/// Constructs a new context.
///
/// C analog: `EVP_DigestInit`
/// C analogs: `EVP_DigestInit`, `EVP_DigestInit_ex`
pub fn new(algorithm: &'static Algorithm) -> Context {
let mut ctx = Context {
algorithm: algorithm,
@ -85,7 +85,7 @@ impl Context {
/// consumes the context so it cannot be (mis-)used after `finish` has been
/// called.
///
/// C analog: `EVP_DigestFinal`
/// C analogs: `EVP_DigestFinal`, `EVP_DigestFinal_ex`
pub fn finish(mut self) -> Digest {
let mut digest = Digest {
algorithm: self.algorithm,