Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "p521: fiat-constify update (#1003)" #1010

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bign256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rust-version = "1.65"
elliptic-curve = { version = "0.13.8", features = ["hazmat", "sec1"] }

# optional dependencies
primeorder = { version = "0.13.5", optional = true }
primeorder = { version = "0.13.5", optional = true, path = "../primeorder" }
signature = { version = "2", optional = true }
belt-hash = { version = "0.1.0", optional = true, default-features = false }
crypto-bigint = { version = "0.5.5", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bp256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ elliptic-curve = { version = "0.13", default-features = false, features = ["hazm

# optional dependencies
ecdsa = { version = "0.16", optional = true, default-features = false, features = ["der"] }
primeorder = { version = "0.13.5", optional = true }
primeorder = { version = "0.13.5", optional = true, path = "../primeorder" }
sha2 = { version = "0.10", optional = true, default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion bp384/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ elliptic-curve = { version = "0.13", default-features = false, features = ["hazm

# optional dependencies
ecdsa = { version = "0.16", optional = true, default-features = false, features = ["der"] }
primeorder = { version = "0.13.5", optional = true }
primeorder = { version = "0.13.5", optional = true, path = "../primeorder" }
sha2 = { version = "0.10", optional = true, default-features = false }

[features]
Expand Down
4 changes: 2 additions & 2 deletions p192/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ sec1 = { version = "0.7.3", default-features = false }
# optional dependencies
ecdsa-core = { version = "0.16.6", package = "ecdsa", optional = true, default-features = false, features = ["der"] }
hex-literal = { version = "0.4", optional = true }
primeorder = { version = "0.13.5", optional = true }
primeorder = { version = "0.13.5", optional = true, path = "../primeorder" }
serdect = { version = "0.2", optional = true, default-features = false }

[dev-dependencies]
ecdsa-core = { version = "0.16", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.4"
primeorder = { version = "0.13", features = ["dev"] }
primeorder = { version = "0.13", features = ["dev"], path = "../primeorder" }

[features]
default = ["arithmetic", "ecdsa", "pem", "std"]
Expand Down
4 changes: 2 additions & 2 deletions p224/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ elliptic-curve = { version = "0.13.8", default-features = false, features = ["ha
# optional dependencies
ecdsa-core = { version = "0.16.6", package = "ecdsa", optional = true, default-features = false, features = ["der"] }
hex-literal = { version = "0.4", optional = true }
primeorder = { version = "0.13.5", optional = true }
primeorder = { version = "0.13.5", optional = true, path = "../primeorder" }
serdect = { version = "0.2", optional = true, default-features = false }
sha2 = { version = "0.10", optional = true, default-features = false }

[dev-dependencies]
blobby = "0.3"
ecdsa-core = { version = "0.16", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.4"
primeorder = { version = "0.13", features = ["dev"] }
primeorder = { version = "0.13", features = ["dev"], path = "../primeorder" }
rand_core = { version = "0.6", features = ["getrandom"] }

[features]
Expand Down
4 changes: 2 additions & 2 deletions p256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elliptic-curve = { version = "0.13.8", default-features = false, features = ["ha
# optional dependencies
ecdsa-core = { version = "0.16", package = "ecdsa", optional = true, default-features = false, features = ["der"] }
hex-literal = { version = "0.4", optional = true }
primeorder = { version = "0.13", optional = true }
primeorder = { version = "0.13", optional = true, path = "../primeorder" }
serdect = { version = "0.2", optional = true, default-features = false }
sha2 = { version = "0.10", optional = true, default-features = false }

Expand All @@ -31,7 +31,7 @@ blobby = "0.3"
criterion = "0.5"
ecdsa-core = { version = "0.16", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.4"
primeorder = { version = "0.13.5", features = ["dev"] }
primeorder = { version = "0.13.5", features = ["dev"], path = "../primeorder" }
proptest = "1"
rand_core = { version = "0.6", features = ["getrandom"] }

Expand Down
4 changes: 2 additions & 2 deletions p384/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elliptic-curve = { version = "0.13", default-features = false, features = ["hazm
# optional dependencies
ecdsa-core = { version = "0.16", package = "ecdsa", optional = true, default-features = false, features = ["der"] }
hex-literal = { version = "0.4", optional = true }
primeorder = { version = "0.13.1", optional = true }
primeorder = { version = "0.13.1", optional = true, path = "../primeorder" }
serdect = { version = "0.2", optional = true, default-features = false }
sha2 = { version = "0.10", optional = true, default-features = false }

Expand All @@ -31,7 +31,7 @@ blobby = "0.3"
criterion = "0.5"
ecdsa-core = { version = "0.16", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.4"
primeorder = { version = "0.13.5", features = ["dev"] }
primeorder = { version = "0.13.5", features = ["dev"], path = "../primeorder" }
proptest = "1.4"
rand_core = { version = "0.6", features = ["getrandom"] }

Expand Down
11 changes: 0 additions & 11 deletions p521/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ hex-literal = "0.4"
primeorder = { version = "0.13.3", features = ["dev"], path = "../primeorder" }
proptest = "1.4"
rand_core = { version = "0.6", features = ["getrandom"] }
criterion = "0.5.1"

[features]
default = ["arithmetic", "ecdsa", "getrandom", "pem", "std"]
Expand All @@ -45,7 +44,6 @@ arithmetic = ["dep:primeorder"]
digest = ["ecdsa-core/digest", "ecdsa-core/hazmat"]
ecdh = ["arithmetic", "elliptic-curve/ecdh"]
ecdsa = ["arithmetic", "ecdsa-core/signing", "ecdsa-core/verifying", "sha512"]
expose-field = ["arithmetic"]
getrandom = ["rand_core/getrandom"]
hash2curve = ["arithmetic", "elliptic-curve/hash2curve"]
jwk = ["elliptic-curve/jwk"]
Expand All @@ -59,12 +57,3 @@ voprf = ["elliptic-curve/voprf", "dep:sha2"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[[bench]]
name = "field"
harness = false
required-features = ["expose-field"]

[[bench]]
name = "scalar"
harness = false
54 changes: 0 additions & 54 deletions p521/benches/field.rs

This file was deleted.

73 changes: 0 additions & 73 deletions p521/benches/scalar.rs

This file was deleted.

10 changes: 4 additions & 6 deletions p521/src/arithmetic/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,13 @@ impl From<u128> for FieldElement {

impl ConditionallySelectable for FieldElement {
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {
let mut ret = Self::ZERO.0.into_inner();
let a = a.0.as_inner();
let b = b.0.as_inner();
let mut ret = Self::ZERO;

for i in 0..ret.len() {
ret[i] = u64::conditional_select(&a[i], &b[i], choice);
for i in 0..ret.0.len() {
ret.0[i] = u64::conditional_select(&a.0[i], &b.0[i], choice);
}

Self(fiat_p521_tight_field_element(ret))
ret
}
}

Expand Down
Loading
Loading