Skip to content

Commit

Permalink
Fix the issue that array size exceed the boundary
Browse files Browse the repository at this point in the history
input_data exceed its boundary which make classes array is not randomized. After modification, the trace 17 can't pass but this makes sence because implementation of precentiles should make the dudect have less leakage durability.
  • Loading branch information
paul90317 committed May 10, 2023
1 parent e413da0 commit ed538f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dudect/constant.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void prepare_inputs(uint8_t *input_data, uint8_t *classes)
{
randombytes(input_data, N_MEASURES * CHUNK_SIZE);
for (size_t i = 0; i < N_MEASURES; i++) {
classes[i] = rand() & 1;
classes[i] = randombit();
if (classes[i] == 0)
memset(input_data + i * CHUNK_SIZE, 0, CHUNK_SIZE);
}
Expand Down
2 changes: 1 addition & 1 deletion dudect/fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int64_t before_ticks[N_MEASURES];
int64_t after_ticks[N_MEASURES];
int64_t exec_times[N_MEASURES];
uint8_t classes[N_MEASURES];
uint8_t input_data[N_MEASURES];
uint8_t input_data[N_MEASURES * CHUNK_SIZE];
FILE *dudect_out;
static report_state_t dudect_main(int mode)
{
Expand Down

0 comments on commit ed538f8

Please sign in to comment.