Mercurial > dropbear
comparison ltc_prng.c @ 761:ac2158e3e403 ecc
ecc kind of works, needs fixing/testing
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 07 Apr 2013 01:36:42 +0800 |
parents | 76fba0856749 |
children | c19acba28590 |
comparison
equal
deleted
inserted
replaced
760:f336d232fc63 | 761:ac2158e3e403 |
---|---|
31 /** | 31 /** |
32 Start the PRNG | 32 Start the PRNG |
33 @param prng [out] The PRNG state to initialize | 33 @param prng [out] The PRNG state to initialize |
34 @return CRYPT_OK if successful | 34 @return CRYPT_OK if successful |
35 */ | 35 */ |
36 int dropbear_prng_start(prng_state *prng) | 36 int dropbear_prng_start(prng_state* UNUSED(prng)) |
37 { | 37 { |
38 return CRYPT_OK; | 38 return CRYPT_OK; |
39 } | 39 } |
40 | 40 |
41 /** | 41 /** |
43 @param in The data to add | 43 @param in The data to add |
44 @param inlen Length of the data to add | 44 @param inlen Length of the data to add |
45 @param prng PRNG state to update | 45 @param prng PRNG state to update |
46 @return CRYPT_OK if successful | 46 @return CRYPT_OK if successful |
47 */ | 47 */ |
48 int dropbear_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) | 48 int dropbear_prng_add_entropy(const unsigned char* UNUSED(in), unsigned long UNUSED(inlen), prng_state* UNUSED(prng)) |
49 { | 49 { |
50 return CRYPT_OK; | 50 return CRYPT_OK; |
51 } | 51 } |
52 | 52 |
53 /** | 53 /** |
54 Make the PRNG ready to read from | 54 Make the PRNG ready to read from |
55 @param prng The PRNG to make active | 55 @param prng The PRNG to make active |
56 @return CRYPT_OK if successful | 56 @return CRYPT_OK if successful |
57 */ | 57 */ |
58 int dropbear_prng_ready(prng_state *prng) | 58 int dropbear_prng_ready(prng_state* UNUSED(prng)) |
59 { | 59 { |
60 return CRYPT_OK; | 60 return CRYPT_OK; |
61 } | 61 } |
62 | 62 |
63 /** | 63 /** |
65 @param out Destination | 65 @param out Destination |
66 @param outlen Length of output | 66 @param outlen Length of output |
67 @param prng The active PRNG to read from | 67 @param prng The active PRNG to read from |
68 @return Number of octets read | 68 @return Number of octets read |
69 */ | 69 */ |
70 unsigned long dropbear_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) | 70 unsigned long dropbear_prng_read(unsigned char* out, unsigned long outlen, prng_state* UNUSED(prng)) |
71 { | 71 { |
72 LTC_ARGCHK(out != NULL); | 72 LTC_ARGCHK(out != NULL); |
73 genrandom(out, outlen); | 73 genrandom(out, outlen); |
74 return CRYPT_OK; | 74 return outlen; |
75 } | 75 } |
76 | 76 |
77 /** | 77 /** |
78 Terminate the PRNG | 78 Terminate the PRNG |
79 @param prng The PRNG to terminate | 79 @param prng The PRNG to terminate |
80 @return CRYPT_OK if successful | 80 @return CRYPT_OK if successful |
81 */ | 81 */ |
82 int dropbear_prng_done(prng_state *prng) | 82 int dropbear_prng_done(prng_state* UNUSED(prng)) |
83 { | 83 { |
84 return CRYPT_OK; | 84 return CRYPT_OK; |
85 } | 85 } |
86 | 86 |
87 /** | 87 /** |
89 @param out [out] Destination | 89 @param out [out] Destination |
90 @param outlen [in/out] Max size and resulting size of the state | 90 @param outlen [in/out] Max size and resulting size of the state |
91 @param prng The PRNG to export | 91 @param prng The PRNG to export |
92 @return CRYPT_OK if successful | 92 @return CRYPT_OK if successful |
93 */ | 93 */ |
94 int dropbear_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) | 94 int dropbear_prng_export(unsigned char* UNUSED(out), unsigned long* outlen, prng_state* UNUSED(prng)) |
95 { | 95 { |
96 LTC_ARGCHK(outlen != NULL); | 96 LTC_ARGCHK(outlen != NULL); |
97 | 97 |
98 *outlen = 0; | 98 *outlen = 0; |
99 return CRYPT_OK; | 99 return CRYPT_OK; |
104 @param in The PRNG state | 104 @param in The PRNG state |
105 @param inlen Size of the state | 105 @param inlen Size of the state |
106 @param prng The PRNG to import | 106 @param prng The PRNG to import |
107 @return CRYPT_OK if successful | 107 @return CRYPT_OK if successful |
108 */ | 108 */ |
109 int dropbear_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) | 109 int dropbear_prng_import(const unsigned char* UNUSED(in), unsigned long UNUSED(inlen), prng_state* UNUSED(prng)) |
110 { | 110 { |
111 return CRYPT_OK; | 111 return CRYPT_OK; |
112 } | 112 } |
113 | 113 |
114 /** | 114 /** |