frontend/zk_iriscode_ss/
parameters.rs

1/// The number of variables of rows of the result of the matrix multiplication
2pub const MATMULT_ROWS_NUM_VARS: usize = 8;
3/// The number of variables of columns of the result of the matrix multiplication
4pub const MATMULT_COLS_NUM_VARS: usize = 2;
5/// The number of internal dimension variables of the matrix multiplication
6pub const MATMULT_INTERNAL_DIM_NUM_VARS: usize = 10;
7
8// Constants defining the digit decomposition of the WC circuit.
9const LOG_NUM_DIGITS: usize = 2;
10/// The number of digits in the complementary decomposition of the thresholded responses.
11pub const NUM_DIGITS: usize = (1 << LOG_NUM_DIGITS) as usize;
12/// The base of the complementary decomposition of the thresholded responses.
13pub const BASE: u64 = 256;
14
15/// The number of rows in the image
16pub const IM_NUM_ROWS: usize = 128;
17
18/// The number of columns in the image
19pub const IM_NUM_COLS: usize = 1024;
20
21/// The log number of columns to use for the Hyrax commitment to the iris/mask code
22pub const IRISCODE_COMMIT_LOG_NUM_COLS: usize = 7;
23
24/// The log number of columns to use for the Hyrax commitment to the Shamir secret share
25/// polynomial slopes
26pub const SHAMIR_SECRET_SHARE_SLOPE_LOG_NUM_COLS: usize = 7;
27
28/// The length of the unpadded iris code
29pub const IRISCODE_LEN: usize = 4 * 16 * 256;
30
31/// The number of variables in the MLE getting rerouted (typically the image input)
32pub const IM_NUM_VARS: usize =
33    (IM_NUM_ROWS.next_power_of_two().ilog2() + IM_NUM_COLS.next_power_of_two().ilog2()) as usize;
34
35/// The wirings from the RLC'd image (2d) to the LH matrix multiplicand (2d), first a flattened u16 array,
36/// then serialized as bytes
37pub static LH_MATRIX_WIRINGS: &[u8] =
38    include_bytes!("constants/v3-split-images/image_strip_to_lh_matrix_wirings.bin");
39
40/// IMAGE STRIPS: the image is decomposed into strips which are RLC'd together.
41/// The number of rows in a strip of the image
42pub const IM_STRIP_NUM_ROWS: usize = 32;
43/// The number of columns in a strip of the image
44pub const IM_STRIP_NUM_COLS: usize = 1024;
45/// The number of image strips = the number of MLEs being RLC'd
46pub const LOG_NUM_STRIPS: usize = 4;
47
48/// The wirings for building the 16 image strips, first a flattened u16 array, then serialized as bytes
49pub static IMAGE_STRIP_WIRINGS: [&[u8]; 1 << LOG_NUM_STRIPS] = [
50    include_bytes!("constants/v3-split-images/image_strip_wirings_0.bin"),
51    include_bytes!("constants/v3-split-images/image_strip_wirings_1.bin"),
52    include_bytes!("constants/v3-split-images/image_strip_wirings_2.bin"),
53    include_bytes!("constants/v3-split-images/image_strip_wirings_3.bin"),
54    include_bytes!("constants/v3-split-images/image_strip_wirings_4.bin"),
55    include_bytes!("constants/v3-split-images/image_strip_wirings_5.bin"),
56    include_bytes!("constants/v3-split-images/image_strip_wirings_6.bin"),
57    include_bytes!("constants/v3-split-images/image_strip_wirings_7.bin"),
58    include_bytes!("constants/v3-split-images/image_strip_wirings_8.bin"),
59    include_bytes!("constants/v3-split-images/image_strip_wirings_9.bin"),
60    include_bytes!("constants/v3-split-images/image_strip_wirings_10.bin"),
61    include_bytes!("constants/v3-split-images/image_strip_wirings_11.bin"),
62    include_bytes!("constants/v3-split-images/image_strip_wirings_12.bin"),
63    include_bytes!("constants/v3-split-images/image_strip_wirings_13.bin"),
64    include_bytes!("constants/v3-split-images/image_strip_wirings_14.bin"),
65    include_bytes!("constants/v3-split-images/image_strip_wirings_15.bin"),
66];
67
68/// The thresholds for the iris circuit, first flattened as a 1d i64 array, then serialized as bytes.
69pub static IRIS_THRESHOLDS: &[u8] = include_bytes!("constants/v3-split-images/iris/thresholds.bin");
70
71/// The thresholds for the mask circuit, first flattened as a 1d i64 array, then serialized as bytes.
72pub static MASK_THRESHOLDS: &[u8] = include_bytes!("constants/v3-split-images/mask/thresholds.bin");
73
74/// The RH multiplicand for the iris circuit, first flattened as a 1d i32 array, then serialized as bytes.
75pub static IRIS_RH_MULTIPLICAND: &[u8] =
76    include_bytes!("constants/v3-split-images/iris/rh_multiplicand.bin");
77
78/// The RH multiplicand for the mask circuit, first flattened as a 1d i32 array, then serialized as bytes.
79pub static MASK_RH_MULTIPLICAND: &[u8] =
80    include_bytes!("constants/v3-split-images/mask/rh_multiplicand.bin");