Skip to content

Commit

Permalink
fix checkpoint loading (use carry for add)
Browse files Browse the repository at this point in the history
  • Loading branch information
cathugger committed Aug 6, 2023
1 parent 2b41704 commit 6a2b5e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,11 @@ int main(int argc,char **argv)
fclose(checkout);

// Apply checkpoint to determseed
for (int i = 0; i < SEED_LEN; i++)
determseed[i] += checkpoint[i];
bool carry = 0;
for (int i = 0; i < SEED_LEN; i++) {
determseed[i] += checkpoint[i] + carry;
carry = determseed[i] < checkpoint[i];
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ union pubonionunion {
} i;
} ;

/*
// little endian inc
static void addsk32(u8 *sk)
{
Expand All @@ -160,6 +161,7 @@ static void addsk32(u8 *sk)
if (!c) break;
}
}
*/

// 0123 4567 xxxx --3--> 3456 7xxx
// 0123 4567 xxxx --1--> 1234 567x
Expand Down

0 comments on commit 6a2b5e6

Please sign in to comment.