Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_random.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef APR_RANDOM_H
18 #define APR_RANDOM_H
19 
25 #include "apr_pools.h"
26 #include "apr_thread_proc.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
39 
41 typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash, const void *data,
42  apr_size_t bytes);
44  unsigned char *result);
45 
46 
47 /* FIXME: make this opaque */
53  void *data;
54 };
55 
61 
63 typedef struct apr_random_t apr_random_t;
64 
73 APR_DECLARE(void) apr_random_init(apr_random_t *g, apr_pool_t *p,
74  apr_crypto_hash_t *pool_hash,
75  apr_crypto_hash_t *key_hash,
76  apr_crypto_hash_t *prng_hash);
82 
89 APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,
90  const void *entropy_,
91  apr_size_t bytes);
99  void *random,
100  apr_size_t bytes);
101 
109  void *random,
110  apr_size_t bytes);
116 APR_DECLARE(void) apr_random_barrier(apr_random_t *g);
117 
124 
131 
146 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif /* !APR_RANDOM_H */
void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result)
Definition: apr_random.h:43
size_t apr_size_t
Definition: apr.h:375
void apr_random_after_fork(apr_proc_t *proc)
struct apr_random_t apr_random_t
Definition: apr_random.h:63
Definition: apr_thread_proc.h:144
APR memory allocation.
apr_status_t apr_random_insecure_ready(apr_random_t *r)
apr_status_t apr_random_secure_ready(apr_random_t *r)
apr_crypto_hash_add_t * add
Definition: apr_random.h:50
void apr_random_barrier(apr_random_t *g)
void apr_random_init(apr_random_t *g, apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash)
apr_pool_t * p
void apr_random_add_entropy(apr_random_t *g, const void *entropy_, apr_size_t bytes)
APR Thread and Process Library.
void * data
Definition: apr_random.h:53
#define APR_DECLARE(x)
Definition: macros.h:6
void apr_crypto_hash_add_t(apr_crypto_hash_t *hash, const void *data, apr_size_t bytes)
Definition: apr_random.h:41
apr_crypto_hash_finish_t * finish
Definition: apr_random.h:51
apr_crypto_hash_t * apr_crypto_sha256_new(apr_pool_t *p)
void apr_crypto_hash_init_t(apr_crypto_hash_t *hash)
Definition: apr_random.h:40
apr_status_t apr_random_insecure_bytes(apr_random_t *g, void *random, apr_size_t bytes)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_size_t size
Definition: apr_random.h:52
int apr_status_t
Definition: apr_errno.h:44
request_rec * r
Definition: mod_dav.h:515
apr_status_t apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes)
Definition: apr_random.h:48
apr_random_t * apr_random_standard_new(apr_pool_t *p)
apr_crypto_hash_init_t * init
Definition: apr_random.h:49