use either::Either::*;
use sword::jets::hot::{HotEntry, K_138};

use crate::jets::base_jets::*;
use crate::jets::bp_jets::*;
use crate::jets::crypto_jets::*;
use crate::jets::tip5_jets::*;

pub fn produce_prover_hot_state() -> Vec<HotEntry> {
    let mut jets: Vec<HotEntry> = Vec::new();
    jets.extend(BASE_FIELD_JETS);
    jets.extend(BASE_POLY_JETS);
    jets.extend(ZTD_JETS);
    jets.extend(KEYGEN_JETS);

    jets
}

pub const BASE_FIELD_JETS: &[HotEntry] = &[
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"badd"),
        ],
        1,
        badd_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bsub"),
        ],
        1,
        bsub_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bneg"),
        ],
        1,
        bneg_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bmul"),
        ],
        1,
        bmul_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"ordered-root"),
        ],
        1,
        ordered_root_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpow"),
        ],
        1,
        bpow_jet,
    ),
];

pub const BASE_POLY_JETS: &[HotEntry] = &[
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpoly-to-list"),
        ],
        1,
        bpoly_to_list_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpadd"),
        ],
        1,
        bpadd_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpneg"),
        ],
        1,
        bpneg_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpsub"),
        ],
        1,
        bpsub_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpscal"),
        ],
        1,
        bpscal_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bpmul"),
        ],
        1,
        bpmul_jet,
    ),
    (
        &[
            K_138,
            Left(b"one"),
            Left(b"two"),
            Left(b"tri"),
            Left(b"qua"),
            Left(b"pen"),
            Left(b"zeke"),
            Left(b"bp-hadamard"),
        ],
        1,
        bp_hadamard_jet,
    ),
];

pub const ZTD_JETS: &[HotEntry] = &[(
    &[
        K_138,
        Left(b"one"),
        Left(b"two"),
        Left(b"tri"),
        Left(b"qua"),
        Left(b"pen"),
        Left(b"zeke"),
        Left(b"ext-field"),
        Left(b"misc-lib"),
        Left(b"tip5-lib"),
        Left(b"permutation"),
    ],
    1,
    permutation_jet,
)];

pub const KEYGEN_JETS: &[HotEntry] = &[(
    &[
        K_138,
        Left(b"one"),
        Left(b"two"),
        Left(b"tri"),
        Left(b"qua"),
        Left(b"pen"),
        Left(b"zeke"),
        Left(b"ext-field"),
        Left(b"misc-lib"),
        Left(b"proof-lib"),
        Left(b"utils"),
        Left(b"fri"),
        Left(b"table-lib"),
        Left(b"stark-core"),
        Left(b"fock-core"),
        Left(b"pow"),
        Left(b"stark-engine"),
        Left(b"zose"),
        Left(b"argon"),
        Left(b"argon2"),
    ],
    1,
    argon2_jet,
)];
