[Gmp-commit] /var/hg/gmp: Document mpn_sec_add_1 and mpn_sec_sub_1.

mercurial at gmplib.org mercurial at gmplib.org
Tue Feb 4 21:04:58 UTC 2014


details:   /var/hg/gmp/rev/c8c462275ca0
changeset: 16276:c8c462275ca0
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Tue Feb 04 22:04:51 2014 +0100
description:
Document mpn_sec_add_1 and mpn_sec_sub_1.

diffstat:

 ChangeLog    |   5 +++++
 doc/gmp.texi |  13 +++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r b10663184cbc -r c8c462275ca0 ChangeLog
--- a/ChangeLog	Mon Feb 03 04:29:38 2014 +0100
+++ b/ChangeLog	Tue Feb 04 22:04:51 2014 +0100
@@ -1,3 +1,8 @@
+2014-02-04  Niels Möller  <nisse at lysator.liu.se>
+
+	* doc/gmp.texi (Low-level Functions): Document mpn_sec_add_1 and
+	mpn_sec_sub_1.
+
 2014-02-03 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mini-gmp/mini-gmp.c (mpn_rootrem): Allow NULL argument.
diff -r b10663184cbc -r c8c462275ca0 doc/gmp.texi
--- a/doc/gmp.texi	Mon Feb 03 04:29:38 2014 +0100
+++ b/doc/gmp.texi	Tue Feb 04 22:04:51 2014 +0100
@@ -5698,6 +5698,19 @@
 actual limb values.
 @end deftypefun
 
+ at deftypefun mp_limb_t mpn_sec_add_1 (mp_limb_t *@var{rp}, const mp_limb_t *@var{ap}, mp_size_t @var{n}, mp_limb_t @var{b}, mp_limb_t *@var{tp})
+ at deftypefunx mp_limb_t mpn_sec_sub_1 (mp_limb_t *@var{rp}, const mp_limb_t *@var{ap}, mp_size_t @var{n}, mp_limb_t @var{b}, mp_limb_t *@var{tp})
+Set @var{R} to @var{A} + @var{b} or @var{A} - @var{b}, respectively, where
+ at var{R} = @{@var{rp}, at var{n}@}, @var{A} = @{@var{ap}, at var{n}@}, and @var{b} is
+a single limb. Returns carry.
+
+These functions take @math{O(N)} time, unlike the leaky functions
+ at code{mpn_add_1} which are @math{O(1)} on average. They require scratch space
+of @code{mpn_sec_add_1_itch(@var{n})} and @code{mpn_sec_sub_1_itch(@var{n})}
+limbs, respectively, to be passed in the @var{tp} parameter. The scratch space
+requirements are guaranteed to increase monotonously in the operand size.
+ at end deftypefun
+
 @deftypefun void mpn_sec_mul (mp_limb_t *@var{rp}, const mp_limb_t *@var{ap}, mp_size_t @var{an}, const mp_limb_t *@var{bp}, mp_size_t @var{bn}, mp_limb_t *@var{tp})
 @deftypefunx mp_size_t mpn_sec_mul_itch (mp_size_t @var{an}, mp_size_t @var{bn})
 Set @var{R} to @math{A @times{} B}, where @var{A} = @{@var{ap}, at var{an}@},


More information about the gmp-commit mailing list