mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
import Ruby/OpenSSL 2.0.0.beta.1
* NEWS, {ext,test,sample}/openssl: Import Ruby/OpenSSL 2.0.0.beta.1. ext/openssl is now converted into a default gem. The full commit history since r55538 can be found at: https://github.com/ruby/openssl/compare/08e1881f5663...v2.0.0.beta.1 [Feature #9612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
28bf4d545f
commit
c9dc0164b8
69 changed files with 2970 additions and 1813 deletions
|
@ -41,13 +41,13 @@ ossl_rand_seed(VALUE self, VALUE str)
|
|||
* The +entropy+ argument is (the lower bound of) an estimate of how much
|
||||
* randomness is contained in +str+, measured in bytes.
|
||||
*
|
||||
* Example:
|
||||
* === Example
|
||||
*
|
||||
* pid = $$
|
||||
* now = Time.now
|
||||
* ary = [now.to_i, now.nsec, 1000, pid]
|
||||
* OpenSSL::Random.add(ary.join("").to_s, 0.0)
|
||||
* OpenSSL::Random.seed(ary.join("").to_s)
|
||||
* OpenSSL::Random.add(ary.join, 0.0)
|
||||
* OpenSSL::Random.seed(ary.join)
|
||||
*/
|
||||
static VALUE
|
||||
ossl_rand_add(VALUE self, VALUE str, VALUE entropy)
|
||||
|
@ -101,10 +101,10 @@ ossl_rand_write_file(VALUE self, VALUE filename)
|
|||
* Generates +string+ with +length+ number of cryptographically strong
|
||||
* pseudo-random bytes.
|
||||
*
|
||||
* Example:
|
||||
* === Example
|
||||
*
|
||||
* OpenSSL::Random.random_bytes(12)
|
||||
* => "..."
|
||||
* #=> "..."
|
||||
*/
|
||||
static VALUE
|
||||
ossl_rand_bytes(VALUE self, VALUE len)
|
||||
|
@ -134,10 +134,10 @@ ossl_rand_bytes(VALUE self, VALUE len)
|
|||
* Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if
|
||||
* they are of sufficient length, but are not necessarily unpredictable.
|
||||
*
|
||||
* Example:
|
||||
* === Example
|
||||
*
|
||||
* OpenSSL::Random.pseudo_bytes(12)
|
||||
* => "..."
|
||||
* #=> "..."
|
||||
*/
|
||||
static VALUE
|
||||
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
|
||||
|
@ -214,7 +214,8 @@ void
|
|||
Init_ossl_rand(void)
|
||||
{
|
||||
#if 0
|
||||
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
|
||||
mOSSL = rb_define_module("OpenSSL");
|
||||
eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
|
||||
#endif
|
||||
|
||||
mRandom = rb_define_module_under(mOSSL, "Random");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue