summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-11-19 12:25:24 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-11-19 12:25:24 +0000
commit857a88c5356f8442971dca7db7ea2d6bcb74bb69 (patch)
tree72004c72ccf81837a5a786003abcda494f876f87
parent52e6f5a1ba9f512b49fcbab3236a7785b1075340 (diff)
Fix comment describing BN_mod_sqrt()
It was placed and formatted weirdly. Fix the title of the book referenced and complete the reference's information.
-rw-r--r--lib/libcrypto/bn/bn_sqrt.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libcrypto/bn/bn_sqrt.c b/lib/libcrypto/bn/bn_sqrt.c
index 644797d6679..d9ab5454968 100644
--- a/lib/libcrypto/bn/bn_sqrt.c
+++ b/lib/libcrypto/bn/bn_sqrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_sqrt.c,v 1.11 2022/06/20 15:02:21 tb Exp $ */
+/* $OpenBSD: bn_sqrt.c,v 1.12 2022/11/19 12:25:23 tb Exp $ */
/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* and Bodo Moeller for the OpenSSL project. */
/* ====================================================================
@@ -59,14 +59,16 @@
#include "bn_lcl.h"
+/*
+ * Returns 'ret' such that ret^2 == a (mod p), if it exists, using the
+ * Tonelli-Shanks algorithm following Henri Cohen, "A Course in Computational
+ * Algebraic Number Theory", algorithm 1.5.1, Springer, Berlin, 1996.
+ *
+ * Note: 'p' must be prime!
+ */
+
BIGNUM *
BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
-/* Returns 'ret' such that
- * ret^2 == a (mod p),
- * using the Tonelli/Shanks algorithm (cf. Henri Cohen, "A Course
- * in Algebraic Computational Number Theory", algorithm 1.5.1).
- * 'p' must be prime!
- */
{
BIGNUM *ret = in;
int err = 1;