summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-01-03 08:19:24 +0000
committertb <>2025-01-03 08:19:24 +0000
commit53c047305665076419ac9af8f915d9b41e380316 (patch)
tree70a532e49dd465c65ed91414d0651f15c5c662b5
parentdaed2fc4a25e4ceb7f635f7a181b2a52499630a7 (diff)
downloadopenbsd-53c047305665076419ac9af8f915d9b41e380316.tar.gz
openbsd-53c047305665076419ac9af8f915d9b41e380316.tar.bz2
openbsd-53c047305665076419ac9af8f915d9b41e380316.zip
Fix typo: multipy -> multiply
Reflow the comment to avoid some very unfortunate line wraps. "Note that" is like "literally" a bunch of generally useless noise and best omitted.
-rw-r--r--src/lib/libcrypto/mlkem/mlkem1024.c18
-rw-r--r--src/lib/libcrypto/mlkem/mlkem768.c18
2 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/libcrypto/mlkem/mlkem1024.c b/src/lib/libcrypto/mlkem/mlkem1024.c
index 1de14fde52..f6fccdf6a8 100644
--- a/src/lib/libcrypto/mlkem/mlkem1024.c
+++ b/src/lib/libcrypto/mlkem/mlkem1024.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mlkem1024.c,v 1.5 2024/12/19 23:52:26 tb Exp $ */ 1/* $OpenBSD: mlkem1024.c,v 1.6 2025/01/03 08:19:24 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2024, Google Inc. 3 * Copyright (c) 2024, Google Inc.
4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
@@ -339,14 +339,14 @@ scalar_sub(scalar *lhs, const scalar *rhs)
339} 339}
340 340
341/* 341/*
342 * Multiplying two scalars in the number theoretically transformed state. Since 342 * Multiplying two scalars in the number theoretically transformed state.
343 * 3329 does not have a 512th root of unity, this means we have to interpret 343 * Since 3329 does not have a 512th root of unity, this means we have to
344 * the 2*ith and (2*i+1)th entries of the scalar as elements of GF(3329)[X]/(X^2 344 * interpret the 2*ith and (2*i+1)th entries of the scalar as elements of
345 * - 17^(2*bitreverse(i)+1)) The value of 17^(2*bitreverse(i)+1) mod 3329 is 345 * GF(3329)[X]/(X^2 - 17^(2*bitreverse(i)+1)).
346 * stored in the precomputed |kModRoots| table. Note that our Barrett transform 346 * The value of 17^(2*bitreverse(i)+1) mod 3329 is stored in the precomputed
347 * only allows us to multipy two reduced numbers together, so we need some 347 * |kModRoots| table. Our Barrett transform only allows us to multiply two
348 * intermediate reduction steps, even if an uint64_t could hold 3 multiplied 348 * reduced numbers together, so we need some intermediate reduction steps,
349 * numbers. 349 * even if an uint64_t could hold 3 multiplied numbers.
350 */ 350 */
351static void 351static void
352scalar_mult(scalar *out, const scalar *lhs, const scalar *rhs) 352scalar_mult(scalar *out, const scalar *lhs, const scalar *rhs)
diff --git a/src/lib/libcrypto/mlkem/mlkem768.c b/src/lib/libcrypto/mlkem/mlkem768.c
index 7d99041152..bacde0c0b7 100644
--- a/src/lib/libcrypto/mlkem/mlkem768.c
+++ b/src/lib/libcrypto/mlkem/mlkem768.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mlkem768.c,v 1.6 2024/12/19 23:52:26 tb Exp $ */ 1/* $OpenBSD: mlkem768.c,v 1.7 2025/01/03 08:19:24 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2024, Google Inc. 3 * Copyright (c) 2024, Google Inc.
4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
@@ -338,14 +338,14 @@ scalar_sub(scalar *lhs, const scalar *rhs)
338} 338}
339 339
340/* 340/*
341 * Multiplying two scalars in the number theoretically transformed state. Since 341 * Multiplying two scalars in the number theoretically transformed state.
342 * 3329 does not have a 512th root of unity, this means we have to interpret 342 * Since 3329 does not have a 512th root of unity, this means we have to
343 * the 2*ith and (2*i+1)th entries of the scalar as elements of GF(3329)[X]/(X^2 343 * interpret the 2*ith and (2*i+1)th entries of the scalar as elements of
344 * - 17^(2*bitreverse(i)+1)) The value of 17^(2*bitreverse(i)+1) mod 3329 is 344 * GF(3329)[X]/(X^2 - 17^(2*bitreverse(i)+1)).
345 * stored in the precomputed |kModRoots| table. Note that our Barrett transform 345 * The value of 17^(2*bitreverse(i)+1) mod 3329 is stored in the precomputed
346 * only allows us to multipy two reduced numbers together, so we need some 346 * |kModRoots| table. Our Barrett transform only allows us to multiply two
347 * intermediate reduction steps, even if an uint64_t could hold 3 multiplied 347 * reduced numbers together, so we need some intermediate reduction steps,
348 * numbers. 348 * even if an uint64_t could hold 3 multiplied numbers.
349 */ 349 */
350static void 350static void
351scalar_mult(scalar *out, const scalar *lhs, const scalar *rhs) 351scalar_mult(scalar *out, const scalar *lhs, const scalar *rhs)