rename c to ctr
All checks were successful
continuous-integration/drone/push Build is passing

of "c" and "ctr", the latter resembles "counter" sound more
This commit is contained in:
surtur 2021-10-24 23:14:53 +02:00
parent 7eef4f2951
commit 88414b445d
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 9 additions and 9 deletions

View File

@ -7,30 +7,30 @@ using namespace std;
struct G_state{
long k;
long c;
long ctr;
};
G_state *initialize_generator(){
auto G = new G_state;
G->k = 0;
G->c = 0;
G->ctr = 0;
return G;
};
string do_crypto(long k, long c){
string do_crypto(long k, long ctr){
/* this function calls the block cipher
do whatever atm */
k = 0;
c = 0;
ctr = 0;
return "";
}
G_state generate_blocks(G_state G, int k_blocks){
assert (G.c!=0);
assert (G.ctr!=0);
string r = "";
for (int i = 0; i < k_blocks; ++i) {
r += do_crypto(G.k, G.c);
G.c += 1;
r += do_crypto(G.k, G.ctr);
G.ctr += 1;
}
return G;
}
@ -47,7 +47,7 @@ string generate_random_data(G_state G, uint n){
}
/* do magic to compute r
* r rst-n-bytes(GenerateBlocks(G, ceil(n/16) )) */
string rr = to_string(generate_blocks(G,ceil(n/16)).c);
string rr = to_string(generate_blocks(G,ceil(n/16)).ctr);
r = rr.substr(0,n);
return r;
};

View File

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