~ubuntu-branches/ubuntu/natty/libgcrypt11/natty-proposed

« back to all changes in this revision

Viewing changes to cipher/rand-internal.h

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-16 20:13:32 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090516201332-czkobpu32w318i16
Tags: 1.4.4-2ubuntu1
* Merge from Debian unstable (LP: #364535), remaining changes:
  - Add libgcrypt11-udeb for use by cryptsetup-udeb.
  - Add clean-la.mk, and add a symlink for the .la
  - Install to /lib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* rand-internal.h - header to glue the random functions
2
 
 *      Copyright (C) 1998, 2002 Free Software Foundation, Inc.
3
 
 *
4
 
 * This file is part of Libgcrypt.
5
 
 *
6
 
 * Libgcrypt is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU Lesser general Public License as
8
 
 * published by the Free Software Foundation; either version 2.1 of
9
 
 * the License, or (at your option) any later version.
10
 
 *
11
 
 * Libgcrypt is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU Lesser General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
 
 */
20
 
#ifndef G10_RAND_INTERNAL_H
21
 
#define G10_RAND_INTERNAL_H
22
 
 
23
 
 
24
 
/* Constants used to define the origin of random added to the pool.
25
 
   The code is sensitive to the order of the values.  */
26
 
enum random_origins 
27
 
  {
28
 
    RANDOM_ORIGIN_INIT = 0,      /* Used only for initialization. */
29
 
    RANDOM_ORIGIN_EXTERNAL = 1,  /* Added from an external source.  */
30
 
    RANDOM_ORIGIN_FASTPOLL = 2,  /* Fast random poll function.  */
31
 
    RANDOM_ORIGIN_SLOWPOLL = 3,  /* Slow poll function.  */
32
 
    RANDOM_ORIGIN_EXTRAPOLL = 4  /* Used to mark an extra pool seed
33
 
                                    due to a GCRY_VERY_STRONG_RANDOM
34
 
                                    random request.  */
35
 
  };
36
 
 
37
 
 
38
 
 
39
 
 
40
 
void _gcry_random_progress (const char *what, int printchar,
41
 
                            int current, int total);
42
 
 
43
 
 
44
 
int _gcry_rndlinux_gather_random (void (*add) (const void *, size_t,
45
 
                                               enum random_origins),
46
 
                                   enum random_origins origin,
47
 
                                  size_t length, int level);
48
 
int _gcry_rndunix_gather_random (void (*add) (const void *, size_t,
49
 
                                              enum random_origins),
50
 
                                 enum random_origins origin,
51
 
                                 size_t length, int level);
52
 
int _gcry_rndegd_gather_random (void (*add) (const void *, size_t,
53
 
                                             enum random_origins),
54
 
                                enum random_origins origin,
55
 
                                size_t length, int level);
56
 
int _gcry_rndegd_connect_socket (int nofail);
57
 
int _gcry_rndw32_gather_random (void (*add) (const void *, size_t,
58
 
                                             enum random_origins),
59
 
                                enum random_origins origin,
60
 
                                size_t length, int level);
61
 
void _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, 
62
 
                                                  enum random_origins),
63
 
                                      enum random_origins origin );
64
 
 
65
 
int _gcry_rndhw_failed_p (void);
66
 
void _gcry_rndhw_poll_fast (void (*add)(const void*, size_t,
67
 
                                        enum random_origins),
68
 
                            enum random_origins origin);
69
 
size_t _gcry_rndhw_poll_slow (void (*add)(const void*, size_t,
70
 
                                          enum random_origins),
71
 
                              enum random_origins origin);
72
 
 
73
 
 
74
 
 
75
 
#endif /*G10_RAND_INTERNAL_H*/