forked from plume-sig/zk-nullifier-sig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'plume-sig:main' into main
- Loading branch information
Showing
18 changed files
with
1,022 additions
and
768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
JavaScript implementation of the PLUME signature scheme. | ||
|
||
## API | ||
### sign(message, privateKey) | ||
Signs a message using the provided private key. | ||
* `message` - String message to sign | ||
* `privateKey` - Hex private key | ||
|
||
Returns the PLUME signature. | ||
|
||
### `verify(message, publicKey, signature)` | ||
Verifies a signature matches the message and public key. | ||
* `message` - Original string message | ||
* `publicKey` - Hex public key | ||
* `signature` - PLUME signature | ||
|
||
Returns true if the signature is valid, false otherwise. | ||
|
||
### License | ||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
https://github.com/plume-sig/zk-nullifier-sig/blob/main/README.md | ||
# HAZMAT | ||
Please note that until `v0.1.0` this is very much a preview crate which lets you have some preliminary feel of the structure and the reference implementation approach. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
use thiserror::Error; | ||
// Legacy definitions for errors which will be gone with arkworks upgrade to `>=0.4.0`. | ||
// `use ark_ec::hashing::HashToCurveError;` | ||
|
||
/// This is an error that could occur when running a cryptograhic primitive | ||
#[derive(Error, Debug, PartialEq)] | ||
pub enum CryptoError { | ||
#[error("Cannot hash to curve")] | ||
CannotHashToCurve, | ||
// use thiserror::Error; | ||
|
||
#[error("Cannot encode a point not on the curve")] | ||
PointNotOnCurve, | ||
// /// This is an error that could occur when running a cryptograhic primitive | ||
// #[derive(Error, Debug, PartialEq)] | ||
// pub enum CryptoError { | ||
// #[error("Cannot hash to curve")] | ||
// CannotHashToCurve, | ||
|
||
// #[error("Cannot encode a point not on the curve")] | ||
// PointNotOnCurve, | ||
// } | ||
|
||
// Let's outline what errors will be in `~0.4.0` | ||
/// It's an interim `enum` between legacy definition of the errors and prospective which will be relying on [`ark_ec::hashing::HashToCurveError`]. | ||
#[derive(Debug, Clone)] | ||
pub enum HashToCurveError { | ||
/// Mimics the `ark_ec::hashing::HashToCurveError` enum | ||
UnsupportedCurveError(String), | ||
/// Mimics the `ark_ec::hashing::HashToCurveError` enum | ||
MapToCurveError(String), | ||
/* let's add two more items to absorb everything | ||
in `crate::hash_to_curve` which is | ||
subject to deprecation */ | ||
/// Absorbs any legacy error in [`mod@crate::hash_to_curve`]. They will be deprecated with upgrade to `~0.4.0`. | ||
Legacy, | ||
/// A special case for a reference function. It will be moved to <./examples> with the upgrade to `~0.4.0`. | ||
ReferenceTryAndIncrement, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.