From 09198923bbc9092dfade453e977d3ccbf1eec9ac Mon Sep 17 00:00:00 2001 From: Sam Kim Date: Sun, 26 Apr 2026 10:11:05 +0900 Subject: [PATCH] Add `workspace.package` information and do minor clean-up (#14) * remove README.md in the syscall directory * use workspace dependency in `bls12-381` * add `workspace.package` information * use 2021 edition for bls12-381 * inherit workspace.package for `ed25519-pokos` * cargo fmt --- Cargo.toml | 9 ++++++++- curve25519/curve25519-cuda/Cargo.toml | 5 ++++- curve25519/solana-ed25519/Cargo.toml | 4 +++- experimental/ed25519-pokos/Cargo.toml | 4 ++++ syscall/README.md | 1 - syscall/bls12-381-syscall/Cargo.toml | 12 ++++++------ syscall/bls12-381-syscall/benches/bench_main.rs | 2 +- syscall/bls12-381-syscall/src/addition.rs | 2 +- syscall/bls12-381-syscall/src/decompression.rs | 6 +++--- syscall/bls12-381-syscall/src/multiplication.rs | 4 ++-- syscall/bls12-381-syscall/src/pairing.rs | 2 +- syscall/bls12-381-syscall/src/subtraction.rs | 2 +- syscall/bls12-381-syscall/src/validation.rs | 2 +- 13 files changed, 35 insertions(+), 20 deletions(-) delete mode 100644 syscall/README.md diff --git a/Cargo.toml b/Cargo.toml index 951d0da..aa2d396 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,19 @@ [workspace] members = [ "curve25519/curve25519-cuda", - "curve25519/solana-ed25519", + "curve25519/solana-ed25519", "experimental/ed25519-pokos", "syscall/bls12-381-syscall", ] resolver = "2" +[workspace.package] +authors = ["Anza Maintainers "] +repository = "https://github.com/anza-xyz/cryptography" +homepage = "https://anza.xyz/" +license = "Apache-2.0" +rust-version = "1.89.0" # solana platform-tools rust version + [workspace.dependencies] bincode = "1" blst = "0.3.16" diff --git a/curve25519/curve25519-cuda/Cargo.toml b/curve25519/curve25519-cuda/Cargo.toml index a1fb8af..6ba3e0a 100644 --- a/curve25519/curve25519-cuda/Cargo.toml +++ b/curve25519/curve25519-cuda/Cargo.toml @@ -2,7 +2,10 @@ name = "solana-curve25519-cuda" version = "0.1.0" edition = "2024" -authors = ["Anza Cryptography Team"] +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } [dependencies] curve25519.workspace = true diff --git a/curve25519/solana-ed25519/Cargo.toml b/curve25519/solana-ed25519/Cargo.toml index e10b80b..658ad34 100644 --- a/curve25519/solana-ed25519/Cargo.toml +++ b/curve25519/solana-ed25519/Cargo.toml @@ -6,7 +6,7 @@ rust-version = "1.85.0" authors = [ "Isis Lovecruft ", "Henry de Valence ", - "Anza Cryptography Team", + "Anza Maintainers ", ] readme = "README.md" license = "BSD-3-Clause" @@ -14,6 +14,8 @@ categories = ["cryptography", "no-std"] keywords = ["cryptography", "crypto", "ristretto", "curve25519", "ristretto255"] description = "A pure-Rust implementation of group operations on ristretto255 and Curve25519, with HEEA scalar decomposition (forked from curve25519-dalek)" exclude = ["**/.gitignore", ".gitignore"] +repository = { workspace = true } +homepage = { workspace = true } # Keep the Rust library name as "curve25519" so that all existing `use curve25519::…` # references in doc-tests, dependent crates, and source files remain valid. diff --git a/experimental/ed25519-pokos/Cargo.toml b/experimental/ed25519-pokos/Cargo.toml index ad28a5a..cf04861 100644 --- a/experimental/ed25519-pokos/Cargo.toml +++ b/experimental/ed25519-pokos/Cargo.toml @@ -2,6 +2,10 @@ name = "ed25519-pokos" version = "0.1.0" edition = "2024" +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } [dependencies] bincode.workspace = true diff --git a/syscall/README.md b/syscall/README.md deleted file mode 100644 index 6726375..0000000 --- a/syscall/README.md +++ /dev/null @@ -1 +0,0 @@ -Will host syscall crates. diff --git a/syscall/bls12-381-syscall/Cargo.toml b/syscall/bls12-381-syscall/Cargo.toml index 0b4d9ca..e545e40 100644 --- a/syscall/bls12-381-syscall/Cargo.toml +++ b/syscall/bls12-381-syscall/Cargo.toml @@ -3,11 +3,11 @@ name = "solana-bls12-381-syscall" description = "Solana BLS12-381 Syscall" documentation = "https://docs.rs/solana-bls12-381-syscall" version = "0.1.0" -authors = ["Anza Maintainers "] -repository = "https://github.com/anza-xyz/cryptography" -homepage = "https://anza.xyz/" -license = "Apache-2.0" -edition = "2024" +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -17,7 +17,7 @@ blst = { workspace = true } blstrs = { workspace = true } bytemuck = { workspace = true, features = ["min_const_generics"] } bytemuck_derive = { workspace = true } -group = "0.13.0" +group = { workspace = true } pairing = { workspace = true } [dev-dependencies] diff --git a/syscall/bls12-381-syscall/benches/bench_main.rs b/syscall/bls12-381-syscall/benches/bench_main.rs index 3b938da..939e1e7 100644 --- a/syscall/bls12-381-syscall/benches/bench_main.rs +++ b/syscall/bls12-381-syscall/benches/bench_main.rs @@ -4,7 +4,7 @@ mod test_vectors; use { bytemuck::pod_read_unaligned, - criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}, + criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}, solana_bls12_381_syscall::*, test_vectors::*, }; diff --git a/syscall/bls12-381-syscall/src/addition.rs b/syscall/bls12-381-syscall/src/addition.rs index 003181c..a03a48d 100644 --- a/syscall/bls12-381-syscall/src/addition.rs +++ b/syscall/bls12-381-syscall/src/addition.rs @@ -1,7 +1,7 @@ use { crate::{ + encoding::{swap_fq_endianness, swap_g2_c0_c1, Endianness, PodG1Point, PodG2Point}, Version, - encoding::{Endianness, PodG1Point, PodG2Point, swap_fq_endianness, swap_g2_c0_c1}, }, blstrs::{G1Projective, G2Projective}, }; diff --git a/syscall/bls12-381-syscall/src/decompression.rs b/syscall/bls12-381-syscall/src/decompression.rs index 09f3ae3..7fa1897 100644 --- a/syscall/bls12-381-syscall/src/decompression.rs +++ b/syscall/bls12-381-syscall/src/decompression.rs @@ -1,10 +1,10 @@ use { crate::{ - Version, encoding::{ - Endianness, PodG1Compressed, PodG1Point, PodG2Compressed, PodG2Point, - swap_fq_endianness, swap_g2_c0_c1, + swap_fq_endianness, swap_g2_c0_c1, Endianness, PodG1Compressed, PodG1Point, + PodG2Compressed, PodG2Point, }, + Version, }, blstrs::{G1Affine, G2Affine}, }; diff --git a/syscall/bls12-381-syscall/src/multiplication.rs b/syscall/bls12-381-syscall/src/multiplication.rs index b58c979..dd6b396 100644 --- a/syscall/bls12-381-syscall/src/multiplication.rs +++ b/syscall/bls12-381-syscall/src/multiplication.rs @@ -1,9 +1,9 @@ use { crate::{ - Version, encoding::{ - Endianness, PodG1Point, PodG2Point, PodScalar, swap_fq_endianness, swap_g2_c0_c1, + swap_fq_endianness, swap_g2_c0_c1, Endianness, PodG1Point, PodG2Point, PodScalar, }, + Version, }, blstrs::{G1Projective, G2Projective}, }; diff --git a/syscall/bls12-381-syscall/src/pairing.rs b/syscall/bls12-381-syscall/src/pairing.rs index 34d33cd..5f10803 100644 --- a/syscall/bls12-381-syscall/src/pairing.rs +++ b/syscall/bls12-381-syscall/src/pairing.rs @@ -2,8 +2,8 @@ use { crate::{ + encoding::{serialize_gt, Endianness, PodG1Point, PodG2Point, PodGtElement}, Version, - encoding::{Endianness, PodG1Point, PodG2Point, PodGtElement, serialize_gt}, }, blstrs::{Bls12, G1Affine, G2Prepared, Gt}, group::Group, diff --git a/syscall/bls12-381-syscall/src/subtraction.rs b/syscall/bls12-381-syscall/src/subtraction.rs index 7f35182..dbc6da4 100644 --- a/syscall/bls12-381-syscall/src/subtraction.rs +++ b/syscall/bls12-381-syscall/src/subtraction.rs @@ -1,7 +1,7 @@ use { crate::{ + encoding::{swap_fq_endianness, swap_g2_c0_c1, Endianness, PodG1Point, PodG2Point}, Version, - encoding::{Endianness, PodG1Point, PodG2Point, swap_fq_endianness, swap_g2_c0_c1}, }, blstrs::{G1Projective, G2Projective}, group::prime::PrimeCurveAffine, diff --git a/syscall/bls12-381-syscall/src/validation.rs b/syscall/bls12-381-syscall/src/validation.rs index 37ad507..8106b85 100644 --- a/syscall/bls12-381-syscall/src/validation.rs +++ b/syscall/bls12-381-syscall/src/validation.rs @@ -1,6 +1,6 @@ use crate::{ - Version, encoding::{Endianness, PodG1Point, PodG2Point}, + Version, }; /// Validates that a G1 point is on the curve and in the correct subgroup.