forked from solana-labs/solana
-
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.
Extract curve25519 crate from zk-token-sdk (solana-labs#951)
* extract curve25519 crate * remove obsolete comment * fix Cargo.toml files * fix imports * update lock file * remove unused deps from zk-token-sdk * fmt * add solana-curve25519 patch * add missing override to programs/sbf/Cargo.toml * copy over an allow() * move new crate to curves dir * use workspace version * add back missing dev dep * add missing dependencies to programs/sbf * fmt * move dep to the correct dependency table * remove #[cfg(not(target_os = "solana"))] above errors mod
- Loading branch information
1 parent
4e0afd6
commit b855bd0
Showing
28 changed files
with
141 additions
and
113 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
/farf/ |
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,18 @@ | ||
[package] | ||
name = "solana-curve25519" | ||
description = "Solana Curve25519 Syscalls" | ||
documentation = "https://docs.rs/solana-curve25519" | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
repository = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
|
||
[dependencies] | ||
bytemuck = { workspace = true, features = ["derive"] } | ||
solana-program = { workspace = true } | ||
thiserror = { workspace = true } | ||
|
||
[target.'cfg(not(target_os = "solana"))'.dependencies] | ||
curve25519-dalek = { workspace = true, features = ["serde"] } |
File renamed without changes.
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,25 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Clone, Debug, Eq, PartialEq)] | ||
pub enum Curve25519Error { | ||
#[error("pod conversion failed")] | ||
PodConversion, | ||
} | ||
|
||
#[derive(Error, Clone, Debug, Eq, PartialEq)] | ||
pub enum ElGamalError { | ||
#[error("key derivation method not supported")] | ||
DerivationMethodNotSupported, | ||
#[error("seed length too short for derivation")] | ||
SeedLengthTooShort, | ||
#[error("seed length too long for derivation")] | ||
SeedLengthTooLong, | ||
#[error("failed to deserialize ciphertext")] | ||
CiphertextDeserialization, | ||
#[error("failed to deserialize public key")] | ||
PubkeyDeserialization, | ||
#[error("failed to deserialize keypair")] | ||
KeypairDeserialization, | ||
#[error("failed to deserialize secret key")] | ||
SecretKeyDeserialization, | ||
} |
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,8 @@ | ||
#![allow(clippy::arithmetic_side_effects, clippy::op_ref)] | ||
//! Syscall operations for curve25519 | ||
pub mod curve_syscall_traits; | ||
pub mod edwards; | ||
pub mod errors; | ||
pub mod ristretto; | ||
pub mod scalar; |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.