Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the secure-random Reference Manual, version 0.1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 14:59:16 2020 GMT+0.
• Introduction | What secure-random is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Overview. ~~~~~~~~~ secure-random provides a cryptographically secure pseudo-random number generator (CSPRNG) for Common Lisp. Example: (SECURE-RANDOM:NUMBER 10) => 9 We define an abstract interface for CSPRNG and provide a default implementation of that interface. The library API. ~~~~~~~~~~~~~~~~ Class SECURE-RANDOM:GENERATOR. The base class for all the possible implementations of a secure random number generator. Special variable SECURE-RANDOM:*GENERATOR*. Current value of the random number generator. Used as the default value for the library functions parameter GENERATOR. Generic function BYTES (COUNT GENERATOR) => random bytes. The only generic function which needs to be implemented by a subclass of SECURE-RANDOM:GENERATOR. Generates COUNT cryptographically strong pseudo-random bytes using the random number generator GENERATOR. Returns the bytes as a SIMPLE-ARRAY with ELEMENT-TYPE '(UNSIGNED-BYTE 8). Signals an ERROR in case of problems (for example when the random number generator failed to initialize itself with enough entrophy). Function NUMBER (LIMIT &optional (GENERATOR *GENERATOR*)) => random number. Returns a cryptographically strong pseudo-random number that is a non-negative number less than LIMIT and of the same type as LIMIT (in the current implementation, only INTEGER type is supporeted). LIMIT is a positive number. GENERATOR is an instance of a subclass of the SECURE-RANDOM:GENERATOR. Signals an ERROR in case of problems (for example when the random number generator failed to initialize itself with enough entrophy). Implementation notes. ~~~~~~~~~~~~~~~~~~~~~ The default implementation uses OpenSSL random number generator (via cl+ssl library). We started from the OpenSSL usage because it's the simplest way. Implementation of a pure Common Lisp CSPRNG is desirable, but it would require to write much more code. The problem is not in the CSPRNG algorithms themself, which are relatively simple (just read for example the Wikipedia article, and use Ironclad for the required building blocks). But the problem is in initialization of CSPRNG. Any CSPRNG needs to be initialized by some unguessable value. OpenSSL can gather the initial value from a platform specific service (/dev/random on Unix'es where it present, Windows Crypto API, Entropy Gathering Daemon, etc.). The pure Lisp CSPRNG library would need to re-implement all this code for gathering a truly unguessable initial value. Contact. ~~~~~~~~ Send questions or comments to avodonosov@yandex.ru
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The secure-random system |
Anton Vodonosov <avodonosov@yandex.ru>
MIT
Cryptographically secure pseudo-random number generator for Common Lisp
0.1.0
cl+ssl
secure-random.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The secure-random.asd file | ||
• The secure-random/package.lisp file | ||
• The secure-random/secure-random.lisp file |
Next: The secure-random/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
secure-random.asd
secure-random (system)
Next: The secure-random/secure-random․lisp file, Previous: The secure-random․asd file, Up: Lisp files [Contents][Index]
secure-random (system)
package.lisp
Previous: The secure-random/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
secure-random (system)
secure-random.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The secure-random package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported classes |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
secure-random.lisp (file)
Next: Exported generic functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Returns a cryptographically strong pseudo-random number that is a
non-negative number less than LIMIT and of the same type as LIMIT
(in the current implementation, only INTEGER type is supporeted).
LIMIT is a positive number. GENERATOR is an instance of a
subclass of the SECURE-RANDOM:GENERATOR. Signals an ERROR in case
of problems (for example when the random number generator has not been
initialized with enough entrophy).
secure-random.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
The only generic function which needs to be implemented by a subclass
of SECURE-RANDOM:GENERATOR. Generates COUNT cryptographically strong pseudo-random
bytes using the random number generator GENERATOR. Returns the bytes as a
SIMPLE-ARRAY with ELEMENT-TYPE ’(UNSIGNED-BYTE 8). Signals
an ERROR in case of problems (for example when the random number
generator has not been initialized with enough entrophy).
secure-random.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
The base class for all the possible implementations of secure random number generator.
secure-random.lisp (file)
standard-object (class)
open-ssl-generator (class)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal classes |
Next: Internal classes, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
secure-random.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
secure-random.lisp (file)
generator (class)
bytes (method)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L S |
---|
Jump to: | F L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | B F G M N O |
---|
Jump to: | B F G M N O |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*generator* : | Exported special variables | ||
| |||
S | |||
Special Variable, *generator* : | Exported special variables | ||
|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C G O P S |
---|
Jump to: | C G O P S |
---|