Crate plume_arkworks

Crate plume_arkworks 

Source
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§

pub use secp256k1::Affine;
pub use secp256k1::Fr;
pub use ark_std::rand;

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§

MapToCurveBasedHasher
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.
PlumeSignaturePrivate
PLUME signature witness. Store securely and choose which data from the public part you will use to identify this part.
PlumeSignaturePublic
PLUME signature instance
WBMap

Enums§

HashToCurveError
This is an error that could occur during the hash to curve process
PlumeVersion
An enum representing the variant of the PLUME protocol.

Traits§

AffineRepr
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 of u64 limbs, least-significant limb first.
CanonicalDeserialize
Re-exports the CanonicalDeserialize and CanonicalSerialize traits from ark_serialize crate.
CanonicalSerialize
Re-exports the CanonicalDeserialize and CanonicalSerialize traits from ark_serialize crate.
CurveGroup
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.
HashToCurve
Trait for hashing arbitrary data to a group element on an elliptic curve
PrimeField
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.
SWCurveConfig
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 constants a and b.
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 None if affine is the identity element.
sign
Sign a message.
sign_with_r
Sign a message using the specified r value.

Type Aliases§

Output
Output array of OutputSizeUser implementors.
PublicKey
The public key.
SecretKeyMaterial
The scalar field element representing the secret key.
Sha256
SHA-256 hasher.

Derive Macros§

CanonicalDeserialize
Re-exports the CanonicalDeserialize and CanonicalSerialize traits from ark_serialize crate.
CanonicalSerialize
Re-exports the CanonicalDeserialize and CanonicalSerialize traits from ark_serialize crate.
Zeroize
Derive the Zeroize trait.