Blame crypto/evp/m_mdc2.c
|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
*
|
|
Packit Service |
084de1 |
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
* this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
* in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
* https://www.openssl.org/source/license.html
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#include <stdio.h>
|
|
Packit Service |
084de1 |
#include "internal/cryptlib.h"
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#ifndef OPENSSL_NO_MDC2
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
# include <openssl/evp.h>
|
|
Packit Service |
084de1 |
# include <openssl/objects.h>
|
|
Packit Service |
084de1 |
# include <openssl/x509.h>
|
|
Packit Service |
084de1 |
# include <openssl/mdc2.h>
|
|
Packit Service |
084de1 |
# include <openssl/rsa.h>
|
|
Packit Service |
084de1 |
# include "crypto/evp.h"
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static int init(EVP_MD_CTX *ctx)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
return MDC2_Init(EVP_MD_CTX_md_data(ctx));
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
return MDC2_Update(EVP_MD_CTX_md_data(ctx), data, count);
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static int final(EVP_MD_CTX *ctx, unsigned char *md)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
return MDC2_Final(md, EVP_MD_CTX_md_data(ctx));
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static const EVP_MD mdc2_md = {
|
|
Packit Service |
084de1 |
NID_mdc2,
|
|
Packit Service |
084de1 |
NID_mdc2WithRSA,
|
|
Packit Service |
084de1 |
MDC2_DIGEST_LENGTH,
|
|
Packit Service |
084de1 |
0,
|
|
Packit Service |
084de1 |
init,
|
|
Packit Service |
084de1 |
update,
|
|
Packit Service |
084de1 |
final,
|
|
Packit Service |
084de1 |
NULL,
|
|
Packit Service |
084de1 |
NULL,
|
|
Packit Service |
084de1 |
MDC2_BLOCK,
|
|
Packit Service |
084de1 |
sizeof(EVP_MD *) + sizeof(MDC2_CTX),
|
|
Packit Service |
084de1 |
};
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
const EVP_MD *EVP_mdc2(void)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
return &mdc2_md;
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
#endif
|