/* mpz_lucas_mod -- Helper function for the strong Lucas primality test.
THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES.
Copyright 2018 Free Software Foundation, Inc.
Contributed by Marco Bodrato.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
or
* the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include"gmp-impl.h"
/* Computes V_{k+1}, Q^{k+1} (mod n) for the Lucas' sequence */ /* with P=1, Q=Q; k = n>>b0. */ /* Requires n > 4; b0 > 0; -2*Q must not overflow a long. */ /* If U_{k+1}==0 (mod n) or V_{k+1}==0 (mod n), it returns 1, */ /* otherwise it returns 0 and sets V=V_{k+1} and Qk=Q^{k+1}. */ /* V will never grow beyond SIZ(n), Qk not beyond 2*SIZ(n). */ int
mpz_lucas_mod (mpz_ptr V, mpz_ptr Qk, long Q,
mp_bitcnt_t b0, mpz_srcptr n, mpz_ptr T1, mpz_ptr T2)
{
mp_bitcnt_t bs; int res;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.