Skip to content

Commit 5a88dc6

Browse files
Fix bad merge
1 parent de5e835 commit 5a88dc6

File tree

5 files changed

+11
-24
lines changed

5 files changed

+11
-24
lines changed

examples/ecc/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ pub fn main() {
3838
#[allow(clippy::op_ref)]
3939
let _p3 = &p1 + &p2;
4040

41-
let x1 = Ed25519Coord::from_be_bytes(&hex!(
41+
let x1 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
4242
"216936D3CD6E53FEC0A4E231FDD6DC5C692CC7609525A7B2C9562D608F25D51A"
4343
));
44-
let y1 = Ed25519Coord::from_be_bytes(&hex!(
44+
let y1 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
4545
"6666666666666666666666666666666666666666666666666666666666666658"
4646
));
4747
let p1 = Ed25519Point::from_xy(x1, y1).unwrap();
4848

4949
let x2 = Ed25519Coord::from_u32(2);
50-
let y2 = Ed25519Coord::from_be_bytes(&hex!(
50+
let y2 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
5151
"1A43BF127BDDC4D71FF910403C11DDB5BA2BCDD2815393924657EF111E712631"
5252
));
5353
let p2 = Ed25519Point::from_xy(x2, y2).unwrap();

extensions/ecc/tests/programs/Cargo.toml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,6 @@ required-features = ["k256"]
8383
name = "sec1_decode"
8484
required-features = ["k256"]
8585

86-
[[example]]
87-
name = "ecdsa_recover_p256"
88-
required-features = ["p256"]
89-
90-
[[example]]
91-
name = "ecdsa_recover_k256"
92-
required-features = ["k256"]
93-
94-
[[example]]
95-
name = "sec1_decode"
96-
required-features = ["k256"]
97-
9886
[[example]]
9987
name = "edwards_ec"
10088
required-features = ["ed25519"]

extensions/ecc/tests/programs/examples/decompress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ pub fn main() {
7575
test_impossible_sw_decompression::<CurvePoint1mod4>(&Fp1mod4::from_u8(1), rec_id);
7676

7777
// ed25519
78-
let x = Ed25519Coord::from_le_bytes(&bytes[192..224]);
79-
let y = Ed25519Coord::from_le_bytes(&bytes[224..256]);
78+
let x = Ed25519Coord::from_le_bytes_unchecked(&bytes[192..224]);
79+
let y = Ed25519Coord::from_le_bytes_unchecked(&bytes[224..256]);
8080
let rec_id = x.as_le_bytes()[0] & 1;
8181
test_possible_te_decompression::<Ed25519Point>(&x, &y, rec_id);
8282
// y = 2 is not on the y-coordinate of any point on the Ed25519 curve

extensions/ecc/tests/programs/examples/edwards_ec.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ pub fn main() {
2727

2828
// random point on edwards25519
2929
let x2 = Ed25519Coord::from_u32(2);
30-
let y2 = Ed25519Coord::from_be_bytes(&hex!(
30+
let y2 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
3131
"1A43BF127BDDC4D71FF910403C11DDB5BA2BCDD2815393924657EF111E712631"
3232
));
3333
let mut p2 = Ed25519Point::from_xy(x2, y2).unwrap();
3434

3535
// This is the sum of (x1, y1) and (x2, y2).
36-
let x3 = Ed25519Coord::from_be_bytes(&hex!(
36+
let x3 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
3737
"636C0B519B2C5B1E0D3BFD213F45AFD5DAEE3CECC9B68CF88615101BC78329E6"
3838
));
39-
let y3 = Ed25519Coord::from_be_bytes(&hex!(
39+
let y3 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
4040
"704D8868CB335A7B609D04B9CD619511675691A78861F1DFF7A5EBC389C7EA92"
4141
));
4242

4343
// This is 2 * (x1, y1)
44-
let x4 = Ed25519Coord::from_be_bytes(&hex!(
44+
let x4 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
4545
"56B98CC045559AD2BBC45CAB58D842ECEE264DB9395F6014B772501B62BB7EE8"
4646
));
47-
let y4 = Ed25519Coord::from_be_bytes(&hex!(
47+
let y4 = Ed25519Coord::from_be_bytes_unchecked(&hex!(
4848
"1BCA918096D89C83A15105DF343DC9F7510494407750226DAC0A7620ACE77BEB"
4949
));
5050

extensions/ecc/tests/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ mod tests {
1414
utils::{air_test, air_test_with_min_segments},
1515
};
1616
use openvm_ecc_circuit::{
17-
CurveConfig, EccExtension, Rv32EccConfig, SwCurveCoeffs, ED25519_CONFIG, P256_CONFIG,
18-
SECP256K1_CONFIG,
17+
CurveConfig, Rv32EccConfig, SwCurveCoeffs, ED25519_CONFIG, P256_CONFIG, SECP256K1_CONFIG,
1918
};
2019
use openvm_ecc_transpiler::EccTranspilerExtension;
2120
use openvm_rv32im_transpiler::{

0 commit comments

Comments
 (0)