Skip to content

Commit fe13692

Browse files
committed
poseidon: make Item public with nbits and as_bigint
This will be used for testing
1 parent 0430054 commit fe13692

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

poseidon/src/hash.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use mina_curves::pasta::Fp;
33

44
use crate::{PlonkSpongeConstantsKimchi, Sponge, SpongeParamsForField};
55

6-
enum Item {
6+
pub enum Item {
77
Bool(bool),
88
U2(u8),
99
U8(u8),
@@ -26,7 +26,7 @@ impl std::fmt::Debug for Item {
2626
}
2727

2828
impl Item {
29-
fn nbits(&self) -> u32 {
29+
pub fn nbits(&self) -> u32 {
3030
match self {
3131
Item::Bool(_) => 1,
3232
Item::U2(_) => 2,
@@ -37,7 +37,7 @@ impl Item {
3737
}
3838
}
3939

40-
fn as_bigint(&self) -> u64 {
40+
pub fn as_bigint(&self) -> u64 {
4141
match self {
4242
Item::Bool(v) => *v as u64,
4343
Item::U2(v) => *v as u64,

0 commit comments

Comments
 (0)