diff options
author | Niels M?ller <nisse@lysator.liu.se> | 2014-02-04 22:04:51 +0100 |
---|---|---|
committer | Niels M?ller <nisse@lysator.liu.se> | 2014-02-04 22:04:51 +0100 |
commit | 6ad62ef4629f499acc50c846fd7c61ff0c73ad8a (patch) | |
tree | 85a5984d452770d85b5f9aef144dd8f4348961d6 /doc/gmp.texi | |
parent | 2891e81f089daa4a4e3ee7eeb33f97439d66241f (diff) | |
download | gmp-6ad62ef4629f499acc50c846fd7c61ff0c73ad8a.tar.gz |
Document mpn_sec_add_1 and mpn_sec_sub_1.
Diffstat (limited to 'doc/gmp.texi')
-rw-r--r-- | doc/gmp.texi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/gmp.texi b/doc/gmp.texi index b1cc0b636..3c127fdce 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -5698,6 +5698,19 @@ but independent of the condition @var{cnd}. Like for @code{mpn_add_n} and actual limb values. @end deftypefun +@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}) +@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 +@var{R} = @{@var{rp},@var{n}@}, @var{A} = @{@var{ap},@var{n}@}, and @var{b} is +a single limb. Returns carry. + +These functions take @math{O(N)} time, unlike the leaky functions +@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. +@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},@var{an}@}, |