Skip to content

Commit d0b130c

Browse files
committed
clang-format
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent c95730a commit d0b130c

File tree

7 files changed

+47
-43
lines changed

7 files changed

+47
-43
lines changed

asn1/src/asym_key_dilithium_ed25519.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ int public_key_verify_signature_dilithium_ed25519(
330330
/*
331331
* Verify the signature using Composite-ML-DSA
332332
*/
333-
CKINT(lc_dilithium_ed25519_verify(
334-
&ws->dilithium_sig, ws->ph_message, sizeof(ws->ph_message),
335-
&ws->dilithium_pk));
333+
CKINT(lc_dilithium_ed25519_verify(&ws->dilithium_sig, ws->ph_message,
334+
sizeof(ws->ph_message),
335+
&ws->dilithium_pk));
336336

337337
out:
338338
LC_RELEASE_MEM(ws);
@@ -367,9 +367,9 @@ int public_key_generate_signature_dilithium_ed25519(
367367
sizeof(ws->ph_message)));
368368

369369
/* Sign the signature using Composite-ML-DSA */
370-
CKINT(lc_dilithium_ed25519_sign(
371-
&ws->dilithium_ed25519_sig, ws->ph_message,
372-
sizeof(ws->ph_message), dilithium_ed25519_sk, lc_seeded_rng));
370+
CKINT(lc_dilithium_ed25519_sign(&ws->dilithium_ed25519_sig,
371+
ws->ph_message, sizeof(ws->ph_message),
372+
dilithium_ed25519_sk, lc_seeded_rng));
373373

374374
CKINT(lc_dilithium_ed25519_sig_ptr(&ml_dsa_ptr, &ml_dsa_siglen,
375375
&ed25519_ptr, &ed25519_siglen,

asn1/src/asym_key_dilithium_ed448.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,9 @@ int public_key_verify_signature_dilithium_ed448(
332332
/*
333333
* Verify the signature using Composite-ML-DSA
334334
*/
335-
CKINT(lc_dilithium_ed448_verify(
336-
&ws->dilithium_sig, ws->ph_message, sizeof(ws->ph_message),
337-
&ws->dilithium_pk));
335+
CKINT(lc_dilithium_ed448_verify(&ws->dilithium_sig, ws->ph_message,
336+
sizeof(ws->ph_message),
337+
&ws->dilithium_pk));
338338

339339
out:
340340
LC_RELEASE_MEM(ws);
@@ -369,9 +369,9 @@ int public_key_generate_signature_dilithium_ed448(
369369
sizeof(ws->ph_message)));
370370

371371
/* Sign the signature using Composite-ML-DSA */
372-
CKINT(lc_dilithium_ed448_sign(
373-
&ws->dilithium_ed448_sig, ws->ph_message,
374-
sizeof(ws->ph_message), dilithium_ed448_sk, lc_seeded_rng));
372+
CKINT(lc_dilithium_ed448_sign(&ws->dilithium_ed448_sig, ws->ph_message,
373+
sizeof(ws->ph_message),
374+
dilithium_ed448_sk, lc_seeded_rng));
375375

376376
CKINT(lc_dilithium_ed448_sig_ptr(&ml_dsa_ptr, &ml_dsa_siglen,
377377
&ed448_ptr, &ed448_siglen,

drng/tests/xdrbg128_tester.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
9494
lc_hash_final(xdrbg128_compare, compare1);
9595
unpoison(state->v, LC_XDRBG128_DRNG_KEYSIZE);
9696
rc += lc_compare(compare1, state->v, LC_XDRBG128_DRNG_KEYSIZE,
97-
"Ascon DRNG state generation");
97+
"Ascon DRNG state generation");
9898

9999
/* Verify the generate operation */
100100
if (lc_hash_init(xdrbg128_compare))
@@ -106,7 +106,7 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
106106
CKINT(lc_hash_set_digestsize(xdrbg128_compare, sizeof(compare1)));
107107
lc_hash_final(xdrbg128_compare, compare1);
108108
rc += lc_compare(compare1 + LC_XDRBG128_DRNG_KEYSIZE, exp1,
109-
sizeof(exp1), "Ascon DRNG verification");
109+
sizeof(exp1), "Ascon DRNG verification");
110110

111111
lc_rng_zero(xdrbg128_ctx);
112112

@@ -118,7 +118,7 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
118118
lc_rng_seed(xdrbg128_ctx, seed, sizeof(seed), NULL, 0);
119119
lc_rng_generate(xdrbg128_ctx, exp1, 83, act2, sizeof(act2));
120120
rc += lc_compare(act2, exp83, sizeof(act2),
121-
"Ascon DRNG with alpha 83 bytes");
121+
"Ascon DRNG with alpha 83 bytes");
122122
lc_rng_zero(xdrbg128_ctx);
123123

124124
/*
@@ -128,7 +128,7 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
128128
lc_rng_seed(xdrbg128_ctx, seed, sizeof(seed), NULL, 0);
129129
lc_rng_generate(xdrbg128_ctx, exp1, 84, act2, sizeof(act2));
130130
rc += lc_compare(act2, exp84, sizeof(act2),
131-
"Ascon DRNG with alpha 84 bytes");
131+
"Ascon DRNG with alpha 84 bytes");
132132
lc_rng_zero(xdrbg128_ctx);
133133

134134
/*
@@ -139,7 +139,7 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
139139
lc_rng_seed(xdrbg128_ctx, seed, sizeof(seed), NULL, 0);
140140
lc_rng_generate(xdrbg128_ctx, exp1, 85, act2, sizeof(act2));
141141
rc += lc_compare(act2, exp84, sizeof(act2),
142-
"Ascon DRNG with alpha 85 bytes");
142+
"Ascon DRNG with alpha 85 bytes");
143143
lc_rng_zero(xdrbg128_ctx);
144144

145145
/* Verify the generate operation with additional data */
@@ -173,8 +173,8 @@ static int xdrbg128_drng_selftest(struct lc_rng_ctx *xdrbg128_ctx)
173173
LC_XDRBG128_DRNG_KEYSIZE + sizeof(act2)));
174174
lc_hash_final(xdrbg128_compare, compare1);
175175
rc += lc_compare(compare1 + LC_XDRBG128_DRNG_KEYSIZE, exp84,
176-
sizeof(exp84),
177-
"Ascon DRNG with alpha 84 bytes verification");
176+
sizeof(exp84),
177+
"Ascon DRNG with alpha 84 bytes verification");
178178

179179
lc_rng_zero(xdrbg128_ctx);
180180

drng/tests/xdrbg256_tester.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
104104
lc_hash_final(xdrbg256_compare, compare1);
105105
unpoison(state->v, LC_XDRBG256_DRNG_KEYSIZE);
106106
rc += lc_compare(compare1, state->v, LC_XDRBG256_DRNG_KEYSIZE,
107-
"SHAKE DRNG state generation");
107+
"SHAKE DRNG state generation");
108108

109109
/* Verify the generate operation */
110110
/* Use the already generated state from above */
@@ -135,14 +135,15 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
135135
LC_XDRBG256_DRNG_KEYSIZE));
136136
lc_hash_final(xdrbg256_compare, compare1);
137137
/* Second loop iteratipn: generate data */
138-
CKINT(lc_hash_set_digestsize(
139-
xdrbg256_compare, sizeof(compare1) - LC_XDRBG256_DRNG_MAX_CHUNK -
140-
LC_XDRBG256_DRNG_KEYSIZE));
138+
CKINT(lc_hash_set_digestsize(xdrbg256_compare,
139+
sizeof(compare1) -
140+
LC_XDRBG256_DRNG_MAX_CHUNK -
141+
LC_XDRBG256_DRNG_KEYSIZE));
141142
lc_hash_final(xdrbg256_compare, compare1 + LC_XDRBG256_DRNG_MAX_CHUNK +
142143
LC_XDRBG256_DRNG_KEYSIZE);
143144

144145
rc += lc_compare(compare1 + LC_XDRBG256_DRNG_KEYSIZE, exp1,
145-
sizeof(exp1), "SHAKE DRNG verification");
146+
sizeof(exp1), "SHAKE DRNG verification");
146147

147148
lc_rng_zero(xdrbg256_ctx);
148149

@@ -154,7 +155,7 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
154155
lc_rng_seed(xdrbg256_ctx, seed, sizeof(seed), NULL, 0);
155156
lc_rng_generate(xdrbg256_ctx, exp1, 83, act2, sizeof(act2));
156157
rc += lc_compare(act2, exp83, sizeof(act2),
157-
"SHAKE DRNG with alpha 83 bytes");
158+
"SHAKE DRNG with alpha 83 bytes");
158159
lc_rng_zero(xdrbg256_ctx);
159160

160161
/*
@@ -164,7 +165,7 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
164165
lc_rng_seed(xdrbg256_ctx, seed, sizeof(seed), NULL, 0);
165166
lc_rng_generate(xdrbg256_ctx, exp1, 84, act2, sizeof(act2));
166167
rc += lc_compare(act2, exp84, sizeof(act2),
167-
"SHAKE DRNG with alpha 84 bytes");
168+
"SHAKE DRNG with alpha 84 bytes");
168169
lc_rng_zero(xdrbg256_ctx);
169170

170171
/*
@@ -175,7 +176,7 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
175176
lc_rng_seed(xdrbg256_ctx, seed, sizeof(seed), NULL, 0);
176177
lc_rng_generate(xdrbg256_ctx, exp1, 85, act2, sizeof(act2));
177178
rc += lc_compare(act2, exp84, sizeof(act2),
178-
"SHAKE DRNG with alpha 85 bytes");
179+
"SHAKE DRNG with alpha 85 bytes");
179180
lc_rng_zero(xdrbg256_ctx);
180181

181182
/* Verify the generate operation with additional data */
@@ -209,8 +210,8 @@ static int xdrbg256_drng_selftest(struct lc_rng_ctx *xdrbg256_ctx)
209210
LC_XDRBG256_DRNG_KEYSIZE + sizeof(act2)));
210211
lc_hash_final(xdrbg256_compare, compare1);
211212
rc += lc_compare(compare1 + LC_XDRBG256_DRNG_KEYSIZE, exp84,
212-
sizeof(exp84),
213-
"SHAKE DRNG with alpha 84 bytes verification");
213+
sizeof(exp84),
214+
"SHAKE DRNG with alpha 84 bytes verification");
214215

215216
lc_rng_zero(xdrbg256_ctx);
216217

drng/tests/xdrbg512_tester.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
106106
lc_hash_final(xdrbg512_compare, compare1);
107107
unpoison(state->v, LC_XDRBG512_DRNG_KEYSIZE);
108108
rc += lc_compare(compare1, state->v, LC_XDRBG512_DRNG_KEYSIZE,
109-
"SHAKE DRNG state generation");
109+
"SHAKE DRNG state generation");
110110

111111
/* Verify the generate operation */
112112
/* Use the already generated state from above */
@@ -137,14 +137,15 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
137137
LC_XDRBG512_DRNG_KEYSIZE));
138138
lc_hash_final(xdrbg512_compare, compare1);
139139
/* Second loop iteratipn: generate data */
140-
CKINT(lc_hash_set_digestsize(
141-
xdrbg512_compare, sizeof(compare1) - LC_XDRBG512_DRNG_MAX_CHUNK -
142-
LC_XDRBG512_DRNG_KEYSIZE));
140+
CKINT(lc_hash_set_digestsize(xdrbg512_compare,
141+
sizeof(compare1) -
142+
LC_XDRBG512_DRNG_MAX_CHUNK -
143+
LC_XDRBG512_DRNG_KEYSIZE));
143144
lc_hash_final(xdrbg512_compare, compare1 + LC_XDRBG512_DRNG_MAX_CHUNK +
144145
LC_XDRBG512_DRNG_KEYSIZE);
145146

146147
rc += lc_compare(compare1 + LC_XDRBG512_DRNG_KEYSIZE, exp1,
147-
sizeof(exp1), "SHAKE DRNG verification");
148+
sizeof(exp1), "SHAKE DRNG verification");
148149

149150
lc_rng_zero(xdrbg512_ctx);
150151

@@ -157,7 +158,7 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
157158
return 1;
158159
lc_rng_generate(xdrbg512_ctx, exp1, 83, act2, sizeof(act2));
159160
rc += lc_compare(act2, exp83, sizeof(act2),
160-
"SHAKE DRNG with alpha 83 bytes");
161+
"SHAKE DRNG with alpha 83 bytes");
161162
lc_rng_zero(xdrbg512_ctx);
162163

163164
/*
@@ -168,7 +169,7 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
168169
return 1;
169170
lc_rng_generate(xdrbg512_ctx, exp1, 84, act2, sizeof(act2));
170171
rc += lc_compare(act2, exp84, sizeof(act2),
171-
"SHAKE DRNG with alpha 84 bytes");
172+
"SHAKE DRNG with alpha 84 bytes");
172173
lc_rng_zero(xdrbg512_ctx);
173174

174175
/*
@@ -180,7 +181,7 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
180181
return 1;
181182
lc_rng_generate(xdrbg512_ctx, exp1, 85, act2, sizeof(act2));
182183
rc += lc_compare(act2, exp84, sizeof(act2),
183-
"SHAKE DRNG with alpha 85 bytes");
184+
"SHAKE DRNG with alpha 85 bytes");
184185
lc_rng_zero(xdrbg512_ctx);
185186

186187
/* Verify the generate operation with additional data */
@@ -214,8 +215,8 @@ static int xdrbg512_drng_selftest(struct lc_rng_ctx *xdrbg512_ctx)
214215
LC_XDRBG512_DRNG_KEYSIZE + sizeof(act2)));
215216
lc_hash_final(xdrbg512_compare, compare1);
216217
rc += lc_compare(compare1 + LC_XDRBG512_DRNG_KEYSIZE, exp84,
217-
sizeof(exp84),
218-
"SHAKE DRNG with alpha 84 bytes verification");
218+
sizeof(exp84),
219+
"SHAKE DRNG with alpha 84 bytes verification");
219220

220221
lc_rng_zero(xdrbg512_ctx);
221222

hash/src/hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ LC_INTERFACE_FUNCTION(void, lc_hash_final, struct lc_hash_ctx *hash_ctx,
4646
hash->final(hash_ctx->hash_state, digest);
4747
}
4848

49-
LC_INTERFACE_FUNCTION(int, lc_hash_set_digestsize,
50-
struct lc_hash_ctx *hash_ctx, size_t digestsize)
49+
LC_INTERFACE_FUNCTION(int, lc_hash_set_digestsize, struct lc_hash_ctx *hash_ctx,
50+
size_t digestsize)
5151
{
5252
const struct lc_hash *hash;
5353

ml-dsa/src/avx2/dilithium_signature_avx2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ LC_INTERFACE_FUNCTION(int, lc_dilithium_sign_ctx_avx2,
550550
CKINT(signature_domain_separation(
551551
&ctx->dilithium_hash_ctx, ctx->ml_dsa_internal,
552552
ctx->dilithium_prehash_type, ctx->userctx,
553-
ctx->userctxlen, m, mlen, ctx->composite_algorithm, LC_DILITHIUM_NIST_CATEGORY));
553+
ctx->userctxlen, m, mlen, ctx->composite_algorithm,
554+
LC_DILITHIUM_NIST_CATEGORY));
554555
}
555556

556557
ret = lc_dilithium_sign_avx2_internal(sig, ctx, sk, rng_ctx);
@@ -798,7 +799,8 @@ LC_INTERFACE_FUNCTION(int, lc_dilithium_verify_ctx_avx2,
798799
CKINT(signature_domain_separation(
799800
&ctx->dilithium_hash_ctx, ctx->ml_dsa_internal,
800801
ctx->dilithium_prehash_type, ctx->userctx,
801-
ctx->userctxlen, m, mlen, ctx->composite_algorithm, LC_DILITHIUM_NIST_CATEGORY));
802+
ctx->userctxlen, m, mlen, ctx->composite_algorithm,
803+
LC_DILITHIUM_NIST_CATEGORY));
802804
}
803805

804806
ret = lc_dilithium_verify_avx2_internal(sig, pk, ctx);

0 commit comments

Comments
 (0)