Libsodium-based cryptographic primitives, including Cruve25519, Blake2b, and Schnorr signatures
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
A library to perform cryptographic operations for the BOA blockchain.
The library relies on
libsodium for cryptographic primitives,
bitblob package for convenience.
This module exposes a thin wrapper on top of
combining it with
bitblob to provide a more user-friendly experience.
Hash type is a fully
@nogc value type, and passing it to a string printing
function that supports
toString sink is guaranteed not to allocate.
This module exposes thin wrappers on top of
libsodium's cryptographic primitives,
allowing to use more convenient syntax (e.g. operator overload) when manipulating scalar
(numbers on finite field, usually used as private keys) and points (usually used as public key).
This module glues together
Hash to generate signatures.
In order to generate a signature, both the
Scalar and the
Point are used,
so in order to avoid re-generating the
Point every time, a convenience
Pair struct is exposed.
The signature generated is stored in a
Sig structure, however, to separate the chain's data structures
from the crypto code,
Sig can convert to a
agora.crypto.Types) via the
The main interface for this module are the various
sign functions, which can be used in
a pedestrian way (e.g.
Pair kp = Pair.random(); sign(kp, "Message");), or in a more complex fashion
(using a specific
r, or even different scalar and points altogether, to allow for multisig schemes).
This module exposes types which can be used by client code, without importing the types from other modules directly (in other words, it's a leaf module). The aim is to reduce dependencies by allowing a data structure to include a type without gaining knowledge of the hashing or signing routines.
This library require usage of
-preview=in, hence the following minimum versions:
dub >= 1.24
dmd >= 2.095.0
ldc >= 1.25.0
dub.json must include
dflags: [ "-preview=in" ].
If it does not, linker error might be triggered in cases where
ref is inferred.
- Registered by Mathias Lang
- 0.2.1 released 3 months ago
- Copyright © 2021, BPF Korea