Expand description
This crate provides the PLUME signature scheme.
See https://blog.aayushg.com/nullifier for more information.
Find the crate to use with RustCrypto as plume_rustcrypto.
§Examples
use plume_arkworks::{
PlumeSignaturePublic, PlumeSignaturePrivate, PlumeVersion, sign, SWCurveConfig, CurveGroup,
secp256k1::{Fr, Config},
rand::rngs::OsRng
};
let message_the = b"ZK nullifier signature";
// you should get the real secret key you for signing
let sk = <Fr as ark_ff::UniformRand>::rand(&mut OsRng);
let sig = sign(
&mut OsRng, (
&(Config::GENERATOR * sk).into_affine(),
&sk,
), message_the.as_slice(), PlumeVersion::V1
);Re-exports§
Modules§
- fixed_
hasher - Stand-in solution until the default hasher issue is fixed.
- secp256k1
- Stand-in solution until the curve hashing support is merged.
- short_
weierstrass
Structs§
- MapTo
Curve Based Hasher - Helper struct that can be used to construct elements on the elliptic curve from arbitrary messages, by first hashing the message onto a field element and then mapping it to the elliptic curve defined over that field.
- Parameters
- A struct containing parameters for the SW model, including the generator point
g_point. This struct implements traits for (de)serialization. - Plume
Signature Private - PLUME signature witness. Store securely and choose which data from the public part you will use to identify this part.
- Plume
Signature Public - PLUME signature instance
- WBMap
Enums§
- Hash
ToCurve Error - This is an error that could occur during the hash to curve process
- Plume
Version - An
enumrepresenting the variant of the PLUME protocol.
Traits§
- Affine
Repr - The canonical representation of an elliptic curve group element. This should represent the affine coordinates of the point corresponding to this group element.
- BigInteger
- This defines a
BigInteger, a smart wrapper around a sequence ofu64limbs, least-significant limb first. - Canonical
Deserialize - Re-exports the
CanonicalDeserializeandCanonicalSerializetraits fromark_serializecrate. - Canonical
Serialize - Re-exports the
CanonicalDeserializeandCanonicalSerializetraits fromark_serializecrate. - Curve
Group - An opaque representation of an elliptic curve group element that is suitable for efficient group arithmetic.
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Hash
ToCurve - Trait for hashing arbitrary data to a group element on an elliptic curve
- Prime
Field - The interface for a prime field, i.e. the field of integers modulo a prime $p$. In the following example we’ll use the prime field underlying the BLS12-381 G1 curve.
- SWCurve
Config - Constants and convenience functions that collectively define the Short Weierstrass model
of the curve. In this model, the curve equation is
y² = x³ + a * x + b, for constantsaandb. - Zeroize
- Trait for securely erasing values from memory.
Functions§
- hash_
to_ curve - sec1_
affine - Serializes the affine point to its SEC1 compressed encoding and returns the raw bytes.
Returns
Noneifaffineis the identity element. - sign
- Sign a message.
- sign_
with_ r - Sign a message using the specified
rvalue.
Type Aliases§
- Output
- Output array of
OutputSizeUserimplementors. - Public
Key - The public key.
- Secret
KeyMaterial - The scalar field element representing the secret key.
- Sha256
- SHA-256 hasher.
Derive Macros§
- Canonical
Deserialize - Re-exports the
CanonicalDeserializeandCanonicalSerializetraits fromark_serializecrate. - Canonical
Serialize - Re-exports the
CanonicalDeserializeandCanonicalSerializetraits fromark_serializecrate. - Zeroize
- Derive the
Zeroizetrait.