Skip to content

Commit

Permalink
Merge pull request #32 from zkemail/audit/unused-programming-constructs
Browse files Browse the repository at this point in the history
veredise audit fix: Unused program constructs
  • Loading branch information
jp4g authored Jan 13, 2025
2 parents f66b3da + 92a8bda commit f0c3652
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
13 changes: 1 addition & 12 deletions lib/src/partial_hash.nr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::tests::test_inputs::PartialHash::DATA;
use std::hash::sha256_compression;
use std::runtime::is_unconstrained;

Expand Down Expand Up @@ -350,18 +351,6 @@ fn hash_final_block(msg_block: [u8; BLOCK_SIZE], mut state: [u32; 8]) -> [u8; 32
out_h
}

global DATA: [u8; 192] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
];

#[test]
fn test_partial_hash() {
let mut data0 = [0; 128];
Expand Down
15 changes: 15 additions & 0 deletions lib/src/tests/test_inputs.nr
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,18 @@ pub(crate) mod EmailAddresses {
pub(crate) global QUOTES_ADDRESS_SEQUENCE = Sequence { index: 35, length: 29 };
pub(crate) global MALICIOUS_QUOTES_ADDRESS_SEQUENCE = Sequence { index: 8, length: 24 };
}

pub(crate) mod PartialHash {
pub(crate) global DATA: [u8; 192] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191,
];
}

0 comments on commit f0c3652

Please sign in to comment.