@@ -7,7 +7,7 @@ use methods::GUEST_ENCRYPT_ELF;
77use risc0_zkvm:: sha:: rust_crypto:: { Digest , Sha256 } ;
88use risc0_zkvm:: { default_prover, ExecutorEnv } ;
99
10- use common:: INPUT_BYTES_LENGTH ;
10+ use common:: INPUT_BYTES ;
1111
1212fn main ( ) {
1313 // Initialize tracing. In order to view logs, run `RUST_LOG=info cargo run`
@@ -21,7 +21,7 @@ fn main() {
2121 let nonce = [ 0x24 ; 12 ] ;
2222
2323 // 16 byte test
24- let plaintext = [ 0 ; INPUT_BYTES_LENGTH ] ;
24+ let plaintext = INPUT_BYTES ;
2525
2626 // zkVM
2727 let env = ExecutorEnv :: builder ( )
@@ -45,7 +45,7 @@ fn main() {
4545 // sha256 = 16 bytes committed first
4646 let output_digest: [ u8 ; 32 ] = output[ ..32 ] . try_into ( ) . expect ( "sha256 hash reading erorr" ) ;
4747 // Ciphertext is the rest of the journal bytes
48- let mut output_buffer: [ u8 ; INPUT_BYTES_LENGTH ] = output[ 32 ..]
48+ let mut output_buffer: Vec < u8 > = output[ 32 ..]
4949 . try_into ( )
5050 . expect ( "Ciphertext unable to populate buffer" ) ;
5151
@@ -73,8 +73,14 @@ fn main() {
7373
7474 // decrypt ciphertext by applying keystream again
7575 cipher. apply_keystream ( & mut output_buffer) ;
76+
7677 assert_eq ! ( output_buffer, plaintext) ;
77- println ! ( "Decryption of zkVM ciphertext matches input!" )
78+ println ! ( "Decryption of zkVM ciphertext matches input!" ) ;
79+ println ! (
80+ "Output size to publish to DA = {} bytes (seal), {} bytes (ciphertext)" ,
81+ receipt. seal_size( ) ,
82+ output_buffer. len( )
83+ ) ;
7884}
7985
8086fn bytes_to_hex ( bytes : & [ u8 ] ) -> String {
0 commit comments