source: EcnlProtoTool/trunk/openssl-1.1.0e/crypto/rand/rand_lcl.h@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 1.8 KB
Line 
1/*
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (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#ifndef HEADER_RAND_LCL_H
11# define HEADER_RAND_LCL_H
12
13# define ENTROPY_NEEDED 32 /* require 256 bits = 32 bytes of randomness */
14
15# if !defined(USE_MD5_RAND) && !defined(USE_SHA1_RAND) && !defined(USE_MDC2_RAND) && !defined(USE_MD2_RAND)
16# define USE_SHA1_RAND
17# endif
18
19# include <openssl/evp.h>
20# define MD_Update(a,b,c) EVP_DigestUpdate(a,b,c)
21# define MD_Final(a,b) EVP_DigestFinal_ex(a,b,NULL)
22# if defined(USE_MD5_RAND)
23# include <openssl/md5.h>
24# define MD_DIGEST_LENGTH MD5_DIGEST_LENGTH
25# define MD_Init(a) EVP_DigestInit_ex(a,EVP_md5(), NULL)
26# define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_md5(), NULL)
27# elif defined(USE_SHA1_RAND)
28# include <openssl/sha.h>
29# define MD_DIGEST_LENGTH SHA_DIGEST_LENGTH
30# define MD_Init(a) EVP_DigestInit_ex(a,EVP_sha1(), NULL)
31# define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_sha1(), NULL)
32# elif defined(USE_MDC2_RAND)
33# include <openssl/mdc2.h>
34# define MD_DIGEST_LENGTH MDC2_DIGEST_LENGTH
35# define MD_Init(a) EVP_DigestInit_ex(a,EVP_mdc2(), NULL)
36# define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_mdc2(), NULL)
37# elif defined(USE_MD2_RAND)
38# include <openssl/md2.h>
39# define MD_DIGEST_LENGTH MD2_DIGEST_LENGTH
40# define MD_Init(a) EVP_DigestInit_ex(a,EVP_md2(), NULL)
41# define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_md2(), NULL)
42# endif
43
44void rand_hw_xor(unsigned char *buf, size_t num);
45
46#endif
Note: See TracBrowser for help on using the repository browser.