diff options
author | daurnimator <quae@daurnimator.com> | 2015-08-09 00:34:16 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2015-12-18 22:28:47 +1100 |
commit | dd9216f46e2f2a3f55dcf4486db8bb36a4f48fdb (patch) | |
tree | f903d415b07ed7c40373097255c0eeabf57ef08f | |
parent | ae502efbb770605babdf3f73aedfc19be42fe426 (diff) | |
download | luaossl-dd9216f46e2f2a3f55dcf4486db8bb36a4f48fdb.tar.gz luaossl-dd9216f46e2f2a3f55dcf4486db8bb36a4f48fdb.tar.bz2 luaossl-dd9216f46e2f2a3f55dcf4486db8bb36a4f48fdb.zip |
remove trailing whitespace
-rw-r--r-- | src/openssl.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/openssl.c b/src/openssl.c index 9c0f852..e8ec0f4 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -314,7 +314,7 @@ static int badoption(lua_State *L, int index, const char *opt) { | |||
314 | 314 | ||
315 | static int checkoption(lua_State *L, int index, const char *def, const char *const opts[]) { | 315 | static int checkoption(lua_State *L, int index, const char *def, const char *const opts[]) { |
316 | const char *opt = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index); | 316 | const char *opt = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index); |
317 | int i; | 317 | int i; |
318 | 318 | ||
319 | for (i = 0; opts[i]; i++) { | 319 | for (i = 0; opts[i]; i++) { |
320 | if (strieq(opts[i], opt)) | 320 | if (strieq(opts[i], opt)) |
@@ -3826,7 +3826,7 @@ static double timeutc(ASN1_TIME *time) { | |||
3826 | 3826 | ||
3827 | gmtoff *= sign; | 3827 | gmtoff *= sign; |
3828 | } | 3828 | } |
3829 | 3829 | ||
3830 | return tm2unix(&tm, gmtoff); | 3830 | return tm2unix(&tm, gmtoff); |
3831 | badfmt: | 3831 | badfmt: |
3832 | return INFINITY; | 3832 | return INFINITY; |
@@ -7114,7 +7114,7 @@ static unsigned long long rand_llu(lua_State *L) { | |||
7114 | * The following algorithm for rand_uniform() is taken from OpenBSD's | 7114 | * The following algorithm for rand_uniform() is taken from OpenBSD's |
7115 | * arc4random_uniform, written by Otto Moerbeek, with subsequent | 7115 | * arc4random_uniform, written by Otto Moerbeek, with subsequent |
7116 | * simplification by Jorden Verwer. Otto's source code comment reads | 7116 | * simplification by Jorden Verwer. Otto's source code comment reads |
7117 | * | 7117 | * |
7118 | * Uniformity is achieved by generating new random numbers until the one | 7118 | * Uniformity is achieved by generating new random numbers until the one |
7119 | * returned is outside the range [0, 2**32 % upper_bound). This guarantees | 7119 | * returned is outside the range [0, 2**32 % upper_bound). This guarantees |
7120 | * the selected random number will be inside [2**32 % upper_bound, 2**32) | 7120 | * the selected random number will be inside [2**32 % upper_bound, 2**32) |
@@ -7137,22 +7137,22 @@ static unsigned long long rand_llu(lua_State *L) { | |||
7137 | * X-Complaints-To: ne...@news.purdue.edu | 7137 | * X-Complaints-To: ne...@news.purdue.edu |
7138 | * NNTP-Posting-Date: Thu, 14 Nov 2002 16:20:37 +0000 (UTC) | 7138 | * NNTP-Posting-Date: Thu, 14 Nov 2002 16:20:37 +0000 (UTC) |
7139 | * Xref: archiver1.google.com sci.crypt:78935 | 7139 | * Xref: archiver1.google.com sci.crypt:78935 |
7140 | * | 7140 | * |
7141 | * In article <3DCD8D7...@nospam.com>, | 7141 | * In article <3DCD8D7...@nospam.com>, |
7142 | * Michael Amling <nos...@nospam.com> wrote: | 7142 | * Michael Amling <nos...@nospam.com> wrote: |
7143 | * >Carlos Moreno wrote: | 7143 | * >Carlos Moreno wrote: |
7144 | * | 7144 | * |
7145 | * I have already posted on this, but a repeat might be | 7145 | * I have already posted on this, but a repeat might be |
7146 | * in order. | 7146 | * in order. |
7147 | * | 7147 | * |
7148 | * If one can trust random bits, the most bitwise efficient | 7148 | * If one can trust random bits, the most bitwise efficient |
7149 | * manner to get a single random integer between 0 and N-1 | 7149 | * manner to get a single random integer between 0 and N-1 |
7150 | * can be obtained as follows; the code can be made more | 7150 | * can be obtained as follows; the code can be made more |
7151 | * computationally efficient. I believe it is easier to | 7151 | * computationally efficient. I believe it is easier to |
7152 | * understand with gotos. I am assuming N>1. | 7152 | * understand with gotos. I am assuming N>1. |
7153 | * | 7153 | * |
7154 | * i = 0; j = 1; | 7154 | * i = 0; j = 1; |
7155 | * | 7155 | * |
7156 | * loop: j=2*j; i=2*i+RANBIT; | 7156 | * loop: j=2*j; i=2*i+RANBIT; |
7157 | * if (j < N) goto loop; | 7157 | * if (j < N) goto loop; |
7158 | * if (i >= N) { | 7158 | * if (i >= N) { |
@@ -7160,14 +7160,14 @@ static unsigned long long rand_llu(lua_State *L) { | |||
7160 | * j = j - N; | 7160 | * j = j - N; |
7161 | * goto loop:} | 7161 | * goto loop:} |
7162 | * else return (i); | 7162 | * else return (i); |
7163 | * | 7163 | * |
7164 | * The algorithm works because at each stage i is uniform | 7164 | * The algorithm works because at each stage i is uniform |
7165 | * between 0 and j-1. | 7165 | * between 0 and j-1. |
7166 | * | 7166 | * |
7167 | * Another possibility is to generate k bits, where 2^k >= N. | 7167 | * Another possibility is to generate k bits, where 2^k >= N. |
7168 | * If 2^k = c*N + remainder, generate the appropriate value | 7168 | * If 2^k = c*N + remainder, generate the appropriate value |
7169 | * if a k-bit random number is less than c*N. | 7169 | * if a k-bit random number is less than c*N. |
7170 | * | 7170 | * |
7171 | * For N = 17 (numbers just larger than powers of 2 are "bad"), | 7171 | * For N = 17 (numbers just larger than powers of 2 are "bad"), |
7172 | * the amount of information is about 4.09 bits, the best | 7172 | * the amount of information is about 4.09 bits, the best |
7173 | * algorithm to generate one random number takes about 5.765 | 7173 | * algorithm to generate one random number takes about 5.765 |
@@ -7345,7 +7345,7 @@ static int mt_init(void) { | |||
7345 | int i; | 7345 | int i; |
7346 | 7346 | ||
7347 | mt_state.nlock = CRYPTO_num_locks(); | 7347 | mt_state.nlock = CRYPTO_num_locks(); |
7348 | 7348 | ||
7349 | if (!(mt_state.lock = malloc(mt_state.nlock * sizeof *mt_state.lock))) { | 7349 | if (!(mt_state.lock = malloc(mt_state.nlock * sizeof *mt_state.lock))) { |
7350 | error = errno; | 7350 | error = errno; |
7351 | goto epilog; | 7351 | goto epilog; |