2 Cryptography Factories
Link to this section with
@secref["factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
This library relies on foreign libraries for the implementations of
cryptographic primitives. Each foreign library is called a
cryptography provider and it has an associated factory
that maps cryptographic algorithm specifiers to
implementations.
Cryptography providers may be used to obtain algorithm implementations
either explicitly or implicitly. An implementation of a cryptographic
algorithm may be obtained explicitly by calling the appropriate
function (eg, get-digest, get-cipher, etc) on a
factory or list of factories. Alternatively, most functions provided
by this library for performing cryptographic operations accept either
a implementation object or an algorithm specifier. If an algorithm
specifier is given, an implementation is implicitly sought from
the factories in (crypto-factories); if no implementation is
available, an exception is raised.
Returns #t if v is a crypto factory, #f
otherwise.
The list of crypto factories used when implicitly finding an
implementation of a cryptographic algorithm from an algorithm
specifier.
The initial value is '().
Gets the factory associated with a particular cryptographic algorithm
implementation or context.
Returns a list representing the library version associated with
factory, or #f if the library could not be loaded. A
version list starts with the major version number; the total number of
elements depends on the library’s versioning conventions. If the
library does not provide version information, the result is '().
Prints information about factory to the current output
port. In particular, the following information is customarily
included, if relevant:
the version of the underlying foreign library (if known)
the available digests
the available ciphers
the available PK systems
the available EC named curves
the available key-derivation functions
Different crypto providers support different levels of introspection,
so the information is generally provided on a best-effort basis.
2.1 All Factories
Link to this section with
@secref["all" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["all" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
A list containing all of the factories available in the library.
Warning: the order of the factories may change in future versions of
this library. This module is intended as a convenience for interactive
use, not for developing libraries or applications.
2.2 Libcrypto (OpenSSL)
Link to this section with
@secref["libcrypto-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["libcrypto-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
libcrypto,
the cryptography library of OpenSSL. The necessary foreign library is
typically part of the operating system or distributed with Racket.
2.3 GCrypt
Link to this section with
@secref["gcrypt-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["gcrypt-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
GCrypt (aka
libgcrypt), a cryptography library from the GNU project,
originally part of GnuPG. The
libgcrypt.so.20 foreign library is
required.
2.4 Nettle
Link to this section with
@secref["nettle-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["nettle-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
Nettle, a
lightweight cryptography library. The
libnettle.so.{7,6} foreign
library is required, and
libhogweed.so.{5,4} is required for
public-key crypto support.
2.5 Sodium
Link to this section with
@secref["sodium-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["sodium-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
Sodium
(aka
libsodium). This factory does
not provide the
high-level Sodium APIs; it only provides access to some of the
low-level primitives. The
libsodium.so.{23,18} library is required.
2.6 B2 (Blake2)
Link to this section with
@secref["b2-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["b2-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
libb2, a
small library implementing the
Blake2
digest and MAC algorithm. The
libb2.so.1 foreign library is required.
2.7 Argon2
Link to this section with
@secref["argon2-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["argon2-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Factory for
Argon2, a
tiny library implementing the Argon2 password hashing (and key
derivation) function. The
libargon2.so.{1,0} foreign library is
required.
2.8 Decaf
Link to this section with
@secref["decaf-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Link to this section with
@secref["decaf-factory" #:doc '(lib "crypto/scribblings/crypto.scrbl")]
Added in version 1.4 of package crypto-lib.
Factory for
libdecaf,
a library implementing Curve25519 and Curve448. The
libdecaf.so
foreign library is required.