Skip to content

Commit

Permalink
Merge pull request #6 from PQCMayo/fix-calloc-transposed-args
Browse files Browse the repository at this point in the history
Test code: fix wrong order in calloc call (-Wcalloc-transposed-args)
  • Loading branch information
mkannwischer authored Dec 9, 2024
2 parents cad1ed8 + 751aaf6 commit bd9e97f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static int example_mayo(const mayo_params_t* p) {
unsigned char *sk = calloc(p->csk_bytes, 1);

unsigned char *epk = calloc(p->epk_bytes, 1);
sk_t *esk = calloc(sizeof(sk_t), 1);
sk_t *esk = calloc(1, sizeof(sk_t));

unsigned char *sig = calloc(p->sig_bytes + msglen, 1);

Expand Down
2 changes: 1 addition & 1 deletion test/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int bench_sig(const mayo_params_t *p, int runs, int csv) {
unsigned char *pk = calloc(p->cpk_bytes, 1);
unsigned char *epk = calloc(p->epk_bytes, 1);
unsigned char *sk = calloc(p->csk_bytes, 1);
sk_t *esk = (sk_t *)calloc(sizeof(sk_t), 1);
sk_t *esk = (sk_t *)calloc(1, sizeof(sk_t));
unsigned char *sig = calloc(p->sig_bytes + m_len, 1);
unsigned char *m = calloc(m_len, 1);
unsigned long long len = p->sig_bytes;
Expand Down

0 comments on commit bd9e97f

Please sign in to comment.