zkhash/neptune/
neptune_instances.rs

1use lazy_static::lazy_static;
2use std::sync::Arc;
3
4use crate::{
5    fields::{bls12::FpBLS12, bn256::FpBN256, pallas::FpPallas, vesta::FpVesta, goldilocks::FpGoldiLocks, babybear::FpBabyBear},
6    neptune::neptune_params::NeptuneParams,
7};
8
9lazy_static! {
10    // Number of partial rounds:
11    // ceil(1.125 * ceil(log_d(2) * (min(kappa, log_2(p)) - 6) + 3 + t + log_d(t)))
12    // BN256
13    pub static ref NEPTUNE_BN_PARAMS: Arc<NeptuneParams<FpBN256>> = Arc::new(NeptuneParams::new(4, 5, 6, 68));
14    // BLS12
15    pub static ref NEPTUNE_BLS_4_PARAMS: Arc<NeptuneParams<FpBLS12>> = Arc::new(NeptuneParams::new(4, 5, 6, 69));
16    pub static ref NEPTUNE_BLS_8_PARAMS: Arc<NeptuneParams<FpBLS12>> = Arc::new(NeptuneParams::new(8, 5, 6, 74));
17    // Goldilocks
18    pub static ref NEPTUNE_GOLDILOCKS_8_PARAMS: Arc<NeptuneParams<FpGoldiLocks>> = Arc::new(NeptuneParams::new(8, 7, 6, 38));
19    pub static ref NEPTUNE_GOLDILOCKS_12_PARAMS: Arc<NeptuneParams<FpGoldiLocks>> = Arc::new(NeptuneParams::new(12, 7, 6, 42));
20    pub static ref NEPTUNE_GOLDILOCKS_16_PARAMS: Arc<NeptuneParams<FpGoldiLocks>> = Arc::new(NeptuneParams::new(16, 7, 6, 48));
21    pub static ref NEPTUNE_GOLDILOCKS_20_PARAMS: Arc<NeptuneParams<FpGoldiLocks>> = Arc::new(NeptuneParams::new(20, 7, 6, 52));
22    // BabyBear
23    pub static ref NEPTUNE_BABYBEAR_16_PARAMS: Arc<NeptuneParams<FpBabyBear>> = Arc::new(NeptuneParams::new(16, 7, 6, 34));
24    pub static ref NEPTUNE_BABYBEAR_24_PARAMS: Arc<NeptuneParams<FpBabyBear>> = Arc::new(NeptuneParams::new(24, 7, 6, 43));
25    // Pallas
26    pub static ref NEPTUNE_PALLAS_4_PARAMS: Arc<NeptuneParams<FpPallas>> = Arc::new(NeptuneParams::new(4, 5, 6, 69));
27    pub static ref NEPTUNE_PALLAS_8_PARAMS: Arc<NeptuneParams<FpPallas>> = Arc::new(NeptuneParams::new(8, 5, 6, 74));
28    // Vesta
29    pub static ref NEPTUNE_VESTA_PARAMS: Arc<NeptuneParams<FpVesta>> = Arc::new(NeptuneParams::new(4, 5, 6, 68));
30}