deserialize assertions to CompressedState (i.e. concrete types of bigint and hasbytes) and get proof
(
asserts: Assertions,
)
| 88 | |
| 89 | // deserialize assertions to CompressedState (i.e. concrete types of bigint and hasbytes) and get proof |
| 90 | fn utils_deserialize_assertions( |
| 91 | asserts: Assertions, |
| 92 | ) -> ( |
| 93 | [CompressedStateObject; NUM_PUBS], |
| 94 | [CompressedStateObject; NUM_U256], |
| 95 | [CompressedStateObject; NUM_HASH], |
| 96 | ) { |
| 97 | let mut cobj_pubs = vec![]; |
| 98 | for i in 0..NUM_PUBS { |
| 99 | let nibs = asserts.0[i].to_vec(); |
| 100 | let cobj = CompressedStateObject::deserialize_from_byte_array(nibs); |
| 101 | cobj_pubs.push(cobj); |
| 102 | } |
| 103 | let cobj_pubs: [CompressedStateObject; NUM_PUBS] = cobj_pubs.try_into().unwrap(); |
| 104 | |
| 105 | let mut cobj_fqs = vec![]; |
| 106 | for i in 0..NUM_U256 { |
| 107 | let nibs = asserts.1[i].to_vec(); |
| 108 | let cobj = CompressedStateObject::deserialize_from_byte_array(nibs); |
| 109 | cobj_fqs.push(cobj); |
| 110 | } |
| 111 | let cobj_fqs: [CompressedStateObject; NUM_U256] = cobj_fqs.try_into().unwrap(); |
| 112 | |
| 113 | let mut cobj_hashes = vec![]; |
| 114 | for i in 0..NUM_HASH { |
| 115 | let nibs = asserts.2[i].to_vec(); |
| 116 | let cobj = CompressedStateObject::deserialize_from_byte_array(nibs); |
| 117 | cobj_hashes.push(cobj); |
| 118 | } |
| 119 | let cobj_hashes: [CompressedStateObject; NUM_HASH] = cobj_hashes.try_into().unwrap(); |
| 120 | |
| 121 | let cobjs: ( |
| 122 | [CompressedStateObject; NUM_PUBS], |
| 123 | [CompressedStateObject; NUM_U256], |
| 124 | [CompressedStateObject; NUM_HASH], |
| 125 | ) = (cobj_pubs, cobj_fqs, cobj_hashes); |
| 126 | |
| 127 | cobjs |
| 128 | } |
| 129 | |
| 130 | // mirror of the funtion get_assertion_from_segments |
| 131 | pub(crate) fn get_segments_from_assertion( |
no test coverage detected