Skip to content

Commit

Permalink
impl Absorb for String
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagician committed Feb 6, 2024
1 parent 38e6e65 commit 53004bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sponge/absorb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ impl Absorb for isize {
}
}

impl Absorb for String {
fn to_sponge_bytes(&self, dest: &mut Vec<u8>) {
dest.extend_from_slice(self.as_bytes())
}

fn to_sponge_field_elements<F: PrimeField>(&self, dest: &mut Vec<F>) {
self.as_bytes().to_sponge_field_elements(dest)
}
}

impl<P: TEModelParameters> Absorb for TEAffine<P>
where
P::BaseField: ToConstraintField<<P::BaseField as Field>::BasePrimeField>,
Expand Down

0 comments on commit 53004bd

Please sign in to comment.