openvm_ecc_guest/
lib.rs
1#![no_std]
2extern crate self as openvm_ecc_guest;
3#[macro_use]
4extern crate alloc;
5
6#[cfg(feature = "halo2curves")]
7pub use halo2curves_axiom as halo2curves;
8pub use once_cell;
9pub use openvm_algebra_guest as algebra;
10pub use openvm_ecc_sw_macros as sw_macros;
11use strum_macros::FromRepr;
12
13mod affine_point;
14pub use affine_point::*;
15mod group;
16pub use group::*;
17mod msm;
18pub use msm::*;
19
20pub mod ecdsa;
22pub mod weierstrass;
24
25#[cfg(feature = "k256")]
27pub mod k256;
28
29#[cfg(feature = "p256")]
31pub mod p256;
32
33#[cfg(all(test, feature = "k256", feature = "p256", not(target_os = "zkvm")))]
34mod tests;
35
36pub const OPCODE: u8 = 0x2b;
38pub const SW_FUNCT3: u8 = 0b001;
39
40#[derive(Debug, Copy, Clone, PartialEq, Eq, FromRepr)]
43#[repr(u8)]
44pub enum SwBaseFunct7 {
45 SwAddNe = 0,
46 SwDouble,
47 SwSetup,
48 HintDecompress,
49 HintNonQr,
50}
51
52impl SwBaseFunct7 {
53 pub const SHORT_WEIERSTRASS_MAX_KINDS: u8 = 8;
54}