Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Stephane Eranian | 8ee4646 | 2015-11-30 10:02:21 +0100 | [diff] [blame] | 2 | #include <openssl/sha.h> |
3 | #include <openssl/md5.h> | ||||
4 | |||||
5 | int main(void) | ||||
6 | { | ||||
7 | MD5_CTX context; | ||||
8 | unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; | ||||
9 | unsigned char dat[] = "12345"; | ||||
10 | |||||
11 | MD5_Init(&context); | ||||
12 | MD5_Update(&context, &dat[0], sizeof(dat)); | ||||
13 | MD5_Final(&md[0], &context); | ||||
14 | |||||
15 | SHA1(&dat[0], sizeof(dat), &md[0]); | ||||
16 | |||||
17 | return 0; | ||||
18 | } |