rhdl_ed25519_fast_core/
export.rs1use anyhow::Result;
8use rhdl::prelude::*;
9
10use crate::{
11 Fast64Core,
12 field_parallel::{FieldMulPipe, Mul51Cell},
13 scalar_parallel::ScalarReducePipe,
14 sha512_parallel::Sha512Compress,
15};
16
17fn component_hdl<C>(component: C, name: &str) -> Result<String>
18where
19 C: Synchronous,
20{
21 unsafe { std::env::set_var("RHDL_SKIP_IVERILOG_CHECK", "1") };
24 Ok(component.descriptor(name.into())?.hdl()?.modules.pretty())
25}
26
27pub fn fast64_core_hdl() -> Result<String> {
32 component_hdl(Fast64Core::default(), "fast64_core_rhdl")
33}
34
35pub fn field_mul_hdl() -> Result<String> {
37 component_hdl(FieldMulPipe::default(), "field_mul_rhdl")
38}
39
40pub fn mul51_cell_hdl() -> Result<String> {
42 component_hdl(Mul51Cell::default(), "mul51_cell_rhdl")
43}
44
45pub fn scalar_reduce_hdl() -> Result<String> {
47 component_hdl(ScalarReducePipe::default(), "scalar_reduce_rhdl")
48}
49
50pub fn sha512_compress_hdl() -> Result<String> {
52 component_hdl(Sha512Compress::default(), "sha512_compress_rhdl")
53}