ctr should never be negative, use unsigned
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-10-24 23:44:43 +02:00
parent 88414b445d
commit cb4bca0b30
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,8 @@ using namespace std;
struct G_state{
long k;
long ctr;
// TODO: use __int128 for ctr eventually;
unsigned long ctr;
};
G_state *initialize_generator(){
@ -17,7 +18,7 @@ G_state *initialize_generator(){
return G;
};
string do_crypto(long k, long ctr){
string do_crypto(long k, unsigned long ctr){
/* this function calls the block cipher
do whatever atm */
k = 0;

View File

@ -9,7 +9,7 @@ struct G_state;
/* initializes generator */
G_state *initialize_generator();
std::string do_crypto(long k, long ctr);
std::string do_crypto(long k, unsigned long ctr);
G_state generate_blocks(G_state G, int k_blocks);