Skip to content

Commit 5b9a3d7

Browse files
authored
enable accessing for table16 (#75)
1 parent 5f758e0 commit 5b9a3d7

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

halo2_gadgets/benches/sha256.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use std::{
1515

1616
use criterion::{criterion_group, criterion_main, Criterion};
1717

18-
use halo2_gadgets::sha256::{BlockWord, Sha256, Table16Chip, Table16Config, BLOCK_SIZE};
18+
use halo2_gadgets::sha256::{
19+
table16::{BlockWord, Table16Chip, Table16Config},
20+
Sha256, BLOCK_SIZE,
21+
};
1922

2023
use halo2_proofs::{
2124
poly::{

halo2_gadgets/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
pub mod ecc;
2727
pub mod poseidon;
28-
//#[cfg(feature = "unstable")]
29-
//#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
28+
#[cfg(feature = "unstable")]
29+
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
3030
pub mod sha256;
3131
pub mod sinsemilla;
3232
pub mod utilities;

halo2_gadgets/src/sha256.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ use halo2_proofs::{
1212
plonk::Error,
1313
};
1414

15-
mod table16;
16-
17-
pub use table16::{BlockWord, Table16Chip, Table16Config};
15+
/// The core circuit for SHA256
16+
pub mod table16;
1817

1918
/// The size of a SHA-256 block, in 32-bit words.
2019
pub const BLOCK_SIZE: usize = 16;

halo2_gadgets/src/sha256/table16.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,17 @@ pub struct Table16Config {
234234
}
235235

236236
impl Table16Config {
237-
pub(crate) fn initialize<F: Field>(
237+
/// export initialize of compression module
238+
pub fn initialize<F: Field>(
238239
&self,
239240
layouter: &mut impl Layouter<F>,
240241
init_state_assigned: [RoundWordDense<F>; STATE],
241242
) -> Result<State<F>, Error> {
242243
self.compression.initialize(layouter, init_state_assigned)
243244
}
244245

245-
pub(crate) fn compress<F: Field>(
246+
/// export compress of compression module
247+
pub fn compress<F: Field>(
246248
&self,
247249
layouter: &mut impl Layouter<F>,
248250
initialized_state: State<F>,
@@ -252,7 +254,8 @@ impl Table16Config {
252254
.compress(layouter, initialized_state, w_halves)
253255
}
254256

255-
pub(crate) fn digest<F: Field>(
257+
/// export digest of compression module
258+
pub fn digest<F: Field>(
256259
&self,
257260
layouter: &mut impl Layouter<F>,
258261
final_state: State<F>,
@@ -262,8 +265,9 @@ impl Table16Config {
262265
.digest(layouter, final_state, initialized_state)
263266
}
264267

268+
/// export message_process module
265269
#[allow(clippy::type_complexity)]
266-
pub(crate) fn message_process<F: Field>(
270+
pub fn message_process<F: Field>(
267271
&self,
268272
layouter: &mut impl Layouter<F>,
269273
input: [BlockWord; super::BLOCK_SIZE],

0 commit comments

Comments
 (0)