[前][次][番号順一覧][スレッド一覧]

ruby-changes:35700

From: zzak <ko1@a...>
Date: Sat, 4 Oct 2014 09:01:16 +0900 (JST)
Subject: [ruby-changes:35700] zzak:r47782 (trunk): * ext/openssl/ossl_rand.c: [DOC] Add call signature for pseudo_bytes

zzak	2014-10-04 09:01:07 +0900 (Sat, 04 Oct 2014)

  New Revision: 47782

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47782

  Log:
    * ext/openssl/ossl_rand.c: [DOC] Add call signature for pseudo_bytes
      and random_bytes, wrap lines at 80 chars, and remove useless
      comments.

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl_rand.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47781)
+++ ChangeLog	(revision 47782)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Oct  4 08:59:45 2014  Zachary Scott  <e@z...>
+
+	* ext/openssl/ossl_rand.c: [DOC] Add call signature for pseudo_bytes
+	  and random_bytes, wrap lines at 80 chars, and remove useless
+	  comments.
+
 Sat Oct  4 08:49:34 2014  Zachary Scott  <e@z...>
 
 	* ext/openssl/ossl_rand.c: [DOC] Add rdoc for method descriptions
Index: ext/openssl/ossl_rand.c
===================================================================
--- ext/openssl/ossl_rand.c	(revision 47781)
+++ ext/openssl/ossl_rand.c	(revision 47782)
@@ -2,33 +2,18 @@ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L2
  * $Id$
  * 'OpenSSL for Ruby' project
  * Copyright (C) 2001-2002  Michal Rokos <m.rokos@s...>
+ *
  * All rights reserved.
- */
-/*
+ *
  * This program is licenced under the same licence as Ruby.
  * (See the file 'LICENCE'.)
  */
 #include "ossl.h"
 
-/*
- * Classes
- */
 VALUE mRandom;
 VALUE eRandomError;
 
 /*
- * Struct
- */
-
-/*
- * Public
- */
-
-/*
- * Private
- */
-
-/*
  *  call-seq:
  *     seed(str) -> str
  *
@@ -47,11 +32,15 @@ ossl_rand_seed(VALUE self, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L32
  *  call-seq:
  *     add(str, entropy) -> self
  *
- * Mixes the bytes from +str+ into the Pseudo Random Number Generator(PRNG) state.
- * Thus, if the data from +str+ are unpredictable to an adversary, this increases the uncertainty about the state
- * and makes the PRNG output less predictable.
- * The +entropy+ argument is (the lower bound of) an estimate of how much randomness is contained in +str+,
- * measured in bytes.
+ * Mixes the bytes from +str+ into the Pseudo Random Number Generator(PRNG)
+ * state.
+ *
+ * Thus, if the data from +str+ are unpredictable to an adversary, this
+ * increases the uncertainty about the state and makes the PRNG output less
+ * predictable.
+ *
+ * The +entropy+ argument is (the lower bound of) an estimate of how much
+ * randomness is contained in +str+, measured in bytes.
  *
  *  Example:
  *
@@ -91,8 +80,9 @@ ossl_rand_load_file(VALUE self, VALUE fi https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L80
  *  call-seq:
  *     write_random_file(filename) -> true
  *
- * Writes a number of random generated bytes (currently 1024) to +filename+ which can be used to initialize the PRNG by
- * calling ::load_random_file in a later session.
+ * Writes a number of random generated bytes (currently 1024) to +filename+
+ * which can be used to initialize the PRNG by calling ::load_random_file in a
+ * later session.
  */
 static VALUE
 ossl_rand_write_file(VALUE self, VALUE filename)
@@ -106,9 +96,10 @@ ossl_rand_write_file(VALUE self, VALUE f https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L96
 
 /*
  *  call-seq:
- *     -> string
+ *	random_bytes(length) -> string
  *
- * Generates +string+ with +length+ number of cryptographically strong pseudo-random bytes.
+ * Generates +string+ with +length+ number of cryptographically strong
+ * pseudo-random bytes.
  *
  *  Example:
  *
@@ -131,12 +122,12 @@ ossl_rand_bytes(VALUE self, VALUE len) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L122
 
 /*
  *  call-seq:
- *     -> string
+ *	pseudo_bytes(length) -> string
  *
  * Generates +string+ with +length+ number of pseudo-random bytes.
  *
- * Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if they are of sufficient length,
- * but are not necessarily unpredictable.
+ * Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if
+ * they are of sufficient length, but are not necessarily unpredictable.
  *
  *  Example:
  *
@@ -179,7 +170,9 @@ ossl_rand_egd(VALUE self, VALUE filename https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L170
  *     egd_bytes(filename, length) -> true
  *
  * Queries the entropy gathering daemon EGD on socket path given by +filename+.
- * Fetches +length+ number of bytes and uses ::add to seed the OpenSSL built-in PRNG.
+ *
+ * Fetches +length+ number of bytes and uses ::add to seed the OpenSSL built-in
+ * PRNG.
  */
 static VALUE
 ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]