2021-06-06 04:44:24 -07:00
|
|
|
use pasta_curves::pallas;
|
|
|
|
|
2021-08-18 23:59:39 -07:00
|
|
|
use crate::constants::{OrchardCommitDomains, OrchardFixedBases, OrchardHashDomains};
|
2021-06-06 21:26:02 -07:00
|
|
|
use ecc::chip::EccChip;
|
2021-08-20 00:43:45 -07:00
|
|
|
use poseidon::chip::Pow5T3Chip as PoseidonChip;
|
2021-06-06 10:00:24 -07:00
|
|
|
use sinsemilla::{chip::SinsemillaChip, merkle::chip::MerkleChip};
|
2021-06-06 21:26:02 -07:00
|
|
|
|
|
|
|
impl super::Config {
|
2021-08-18 23:59:39 -07:00
|
|
|
pub(super) fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
|
2021-06-06 21:26:02 -07:00
|
|
|
EccChip::construct(self.ecc_config.clone())
|
|
|
|
}
|
2021-06-06 04:32:59 -07:00
|
|
|
|
2021-08-18 23:59:39 -07:00
|
|
|
pub(super) fn sinsemilla_chip_1(
|
|
|
|
&self,
|
|
|
|
) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
|
2021-06-06 10:00:24 -07:00
|
|
|
SinsemillaChip::construct(self.sinsemilla_config_1.clone())
|
|
|
|
}
|
|
|
|
|
2021-08-18 23:59:39 -07:00
|
|
|
pub(super) fn sinsemilla_chip_2(
|
|
|
|
&self,
|
|
|
|
) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
|
2021-06-06 10:00:24 -07:00
|
|
|
SinsemillaChip::construct(self.sinsemilla_config_2.clone())
|
|
|
|
}
|
|
|
|
|
2021-08-18 23:59:39 -07:00
|
|
|
pub(super) fn merkle_chip_1(
|
|
|
|
&self,
|
|
|
|
) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
|
2021-06-06 04:32:59 -07:00
|
|
|
MerkleChip::construct(self.merkle_config_1.clone())
|
|
|
|
}
|
|
|
|
|
2021-08-18 23:59:39 -07:00
|
|
|
pub(super) fn merkle_chip_2(
|
|
|
|
&self,
|
|
|
|
) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
|
2021-06-06 04:32:59 -07:00
|
|
|
MerkleChip::construct(self.merkle_config_2.clone())
|
|
|
|
}
|
2021-06-06 05:05:51 -07:00
|
|
|
|
|
|
|
pub(super) fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
|
|
|
|
PoseidonChip::construct(self.poseidon_config.clone())
|
|
|
|
}
|
2021-06-06 21:26:02 -07:00
|
|
|
}
|