tpmtool now accepts the --inder and --outder options.
[gnutls.git] / lib / random.h
blob3d24363f2ce238d0309e88bbce15ea3a17cd0605
1 /*
2 * Copyright (C) 2008-2012 Free Software Foundation, Inc.
4 * Author: Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * The GnuTLS is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 #ifndef RANDOM_H
24 #define RANDOM_H
26 #include <gnutls/crypto.h>
27 #include <crypto-backend.h>
29 extern int crypto_rnd_prio;
30 extern void* gnutls_rnd_ctx;
31 extern gnutls_crypto_rnd_st _gnutls_rnd_ops;
33 inline static int
34 _gnutls_rnd (gnutls_rnd_level_t level, void *data, size_t len)
36 if (len > 0)
38 return _gnutls_rnd_ops.rnd (gnutls_rnd_ctx, level, data, len);
40 return 0;
43 void _gnutls_rnd_deinit (void);
44 int _gnutls_rnd_init (void);
46 #endif