use serde::{Deserialize, Serialize};
use crate::bn254::tests::json::types::RawG1Point;
const DECOMPOSITION_TEST_CASES: &str = include_str!("decomposition_tests.json");
const EC_MUL_TEST_CASES: &str = include_str!("ecmul_tests.json");
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecompositionTestCase {
pub k: String,
pub k1: String,
pub k2: String,
pub k2_negated: bool,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecompositionTestCases {
pub tests: Vec<DecompositionTestCase>,
}
pub(in super::super) fn load_decomposition_test_cases() -> DecompositionTestCases {
serde_json::from_str(&DECOMPOSITION_TEST_CASES).expect("Failed to deserialize")
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MultiplicationTestCase {
pub point: RawG1Point,
pub scalar: String,
pub expected: RawG1Point,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MultiplicationTestCases {
pub tests: Vec<MultiplicationTestCase>,
}
pub(in super::super) fn load_multiplication_test_cases() -> MultiplicationTestCases {
serde_json::from_str(&EC_MUL_TEST_CASES).expect("Failed to deserialize")
}