mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-09 09:13:09 +00:00
fix length zero input issue
This commit is contained in:
parent
85b88a1cde
commit
705b4a432f
@ -30,8 +30,8 @@ store_size:
|
||||
store_padding:
|
||||
// stack: i (init 63)
|
||||
%store_zeros(136, store_padding)
|
||||
%jump(store_input_alt)
|
||||
|
||||
%jumpi(store_input_alt)
|
||||
%jump(ripemd_init)
|
||||
|
||||
store_input_alt:
|
||||
// stack: rem, length, REM_INP
|
||||
|
||||
@ -4,6 +4,7 @@ use ethereum_types::U256;
|
||||
use crate::cpu::kernel::aggregator::combined_kernel;
|
||||
use crate::cpu::kernel::interpreter::run_with_kernel;
|
||||
|
||||
|
||||
fn make_input(word: &str) -> Vec<u8> {
|
||||
let mut bytes: Vec<u8> = vec![word.len().try_into().unwrap()];
|
||||
bytes.append(&mut word.as_bytes().to_vec());
|
||||
@ -12,8 +13,8 @@ fn make_input(word: &str) -> Vec<u8> {
|
||||
|
||||
#[test]
|
||||
fn test_ripemd() -> Result<()> {
|
||||
let input: Vec<u8> = make_input("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
||||
let expected = U256::from("0xb0e20b6e3116640286ed3a87a5713079b21f5189");
|
||||
let input: Vec<u8> = make_input("");
|
||||
let expected = U256::from("0x9c1185a5c5e9fc54612808977ee8f548b2258d31");
|
||||
|
||||
let kernel = combined_kernel();
|
||||
let label = kernel.global_labels["ripemd_alt"];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user