VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/crypto/mdc2/mdc2_one.c@ 94082

Last change on this file since 94082 was 94082, checked in by vboxsync, 3 years ago

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

File size: 896 bytes
Line 
1/*
2 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10/*
11 * MD2 low level APIs are deprecated for public use, but still ok for
12 * internal use.
13 */
14#include "internal/deprecated.h"
15
16#include <stdio.h>
17#include "internal/cryptlib.h"
18#include <openssl/mdc2.h>
19
20unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
21{
22 MDC2_CTX c;
23 static unsigned char m[MDC2_DIGEST_LENGTH];
24
25 if (md == NULL)
26 md = m;
27 if (!MDC2_Init(&c))
28 return NULL;
29 MDC2_Update(&c, d, n);
30 MDC2_Final(md, &c);
31 OPENSSL_cleanse(&c, sizeof(c)); /* security consideration */
32 return md;
33}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette