openvm_bigint_circuit/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use openvm_circuit::{self, arch::VmChipWrapper};
use openvm_rv32_adapters::{Rv32HeapAdapterChip, Rv32HeapBranchAdapterChip};
use openvm_rv32im_circuit::{
    adapters::{INT256_NUM_LIMBS, RV32_CELL_BITS},
    BaseAluCoreChip, BranchEqualCoreChip, BranchLessThanCoreChip, LessThanCoreChip,
    MultiplicationCoreChip, ShiftCoreChip,
};

mod extension;
pub use extension::*;

#[cfg(test)]
mod tests;

pub type Rv32BaseAlu256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapAdapterChip<F, 2, INT256_NUM_LIMBS, INT256_NUM_LIMBS>,
    BaseAluCoreChip<INT256_NUM_LIMBS, RV32_CELL_BITS>,
>;

pub type Rv32LessThan256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapAdapterChip<F, 2, INT256_NUM_LIMBS, INT256_NUM_LIMBS>,
    LessThanCoreChip<INT256_NUM_LIMBS, RV32_CELL_BITS>,
>;

pub type Rv32Multiplication256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapAdapterChip<F, 2, INT256_NUM_LIMBS, INT256_NUM_LIMBS>,
    MultiplicationCoreChip<INT256_NUM_LIMBS, RV32_CELL_BITS>,
>;

pub type Rv32Shift256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapAdapterChip<F, 2, INT256_NUM_LIMBS, INT256_NUM_LIMBS>,
    ShiftCoreChip<INT256_NUM_LIMBS, RV32_CELL_BITS>,
>;

pub type Rv32BranchEqual256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapBranchAdapterChip<F, 2, INT256_NUM_LIMBS>,
    BranchEqualCoreChip<INT256_NUM_LIMBS>,
>;

pub type Rv32BranchLessThan256Chip<F> = VmChipWrapper<
    F,
    Rv32HeapBranchAdapterChip<F, 2, INT256_NUM_LIMBS>,
    BranchLessThanCoreChip<INT256_NUM_LIMBS, RV32_CELL_BITS>,
>;