Skip to content

Commit

Permalink
fix kernel compilation complaints
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Mueller <[email protected]>
  • Loading branch information
smuellerDD committed Nov 9, 2023
1 parent b1de40c commit 61a8251
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kem/tests/kyber_kem_x25519_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ static int kyber_kem_double_tester(void)
struct lc_kyber_x25519_ct ct;
uint8_t ss1[sizeof(ss_exp)], ss2[sizeof(ss_exp)];
};
int ret;
LC_DECLARE_MEM(ws, struct workspace, sizeof(uint64_t));
LC_SELFTEST_DRNG_CTX_ON_STACK(selftest_rng);
int ret;

CKINT(lc_kyber_x25519_keypair(&ws->pk, &ws->sk, selftest_rng));

Expand Down
3 changes: 1 addition & 2 deletions signature/src/avx2/dilithium_signature_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,13 @@ static int lc_dilithium_sign_avx2_internal(struct lc_dilithium_sig *sig,
} tmpv;
keccakx4_state keccak_state;
};

LC_DECLARE_MEM(ws, struct workspace_sign, 32);
unsigned int i, n, pos;
uint8_t *rho, *key, *mu, *rhoprime, *rnd;
uint8_t *hint = sig->sig + LC_DILITHIUM_CTILDE_BYTES +
LC_DILITHIUM_L * LC_DILITHIUM_POLYZ_PACKEDBYTES;
uint64_t nonce = 0;
int ret = 0;
LC_DECLARE_MEM(ws, struct workspace_sign, 32);

/* Skip tr which is in rho + LC_DILITHIUM_SEEDBYTES; */
key = ws->seedbuf;
Expand Down
4 changes: 2 additions & 2 deletions signature/src/dilithium_signature_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ static int lc_dilithium_sign_internal(struct lc_dilithium_sig *sig,
uint8_t poly_uniform_buf[WS_POLY_UNIFORM_BUF_SIZE];
} tmp;
};
LC_DECLARE_MEM(ws, struct workspace_sign, sizeof(uint64_t));
unsigned int n;
uint8_t *key, *mu, *rhoprime, *rnd;
uint16_t nonce = 0;
/* The first bytes of the key is rho. */
const uint8_t *rho;
int ret = 0;
LC_DECLARE_MEM(ws, struct workspace_sign, sizeof(uint64_t));

key = ws->seedbuf;
rnd = key + LC_DILITHIUM_SEEDBYTES;
Expand Down Expand Up @@ -469,12 +469,12 @@ static int lc_dilithium_verify_internal(const struct lc_dilithium_sig *sig,
uint8_t poly_challenge_buf[POLY_CHALLENGE_BYTES];
} tmp;
};
LC_DECLARE_MEM(ws, struct workspace_verify, sizeof(uint64_t));
/* The first bytes of the signature is c~ and thus contains c1. */
const uint8_t *c1 = sig->sig;
/* The first bytes of the key is rho. */
const uint8_t *rho = pk->pk;
int ret = 0;
LC_DECLARE_MEM(ws, struct workspace_verify, sizeof(uint64_t));

polyvec_matrix_expand(ws->mat, rho, ws->tmp.poly_uniform_buf);

Expand Down

0 comments on commit 61a8251

Please sign in to comment.