• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/Heimdal-398.1.2/lib/hcrypto/libtommath/

Lines Matching defs:by

80 to implement ``bignum'' math.  However, the resulting code has proven to be very useful.  It has been used by numerous 
87 release as well. This textbook is meant to compliment the project by providing a more solid walkthrough of the development
90 Since both\footnote{Note that the MPI files under mtest/ are copyrighted by Michael Fromberger. They are not required to use LibTomMath.} are in the
96 also build in MSVC, Borland C out of the box. For any other ISO C compiler a makefile will have to be made by the end
120 and static then install (by default) into /usr/lib as well as install the header files in /usr/include. The shared
136 results. ``mtest/mtest'' will generate test vectors using the MPI library by Michael Fromberger\footnote{A copy of MPI
169 In the file tommath\_class.h you will see a large list of C ``defines'' followed by a series of ``ifdefs''
259 are the pros and cons of LibTomMath by comparing it to the math routines from GnuPG\footnote{GnuPG v1.2.3 versus LibTomMath v0.28}.
321 The last two codes listed are not actually ``return'ed'' by a function. They are placed in an integer (the caller must
348 platforms by defining the appropriate macros.
351 hold the structure itself by yourself (whether off stack or heap it doesn't matter). The very first thing that must be
386 by the other LibTomMath functions.
975 \subsection{Multiplication by two}
977 Multiplications and divisions by any power of two can be performed with quick logical shifts either left or
980 When multiplying or dividing by two a special case routine can be used which are as follows.
1005 /* multiply by two */
1017 /* now divide by two */
1043 Since $10 > 7$ and $5 < 7$. To multiply by a power of two the following function can be used.
1050 This will multiply $a$ by $2^b$ and store the result in ``c''. If the value of $b$ is less than or equal to
1053 To divide by a power of two use the following.
1059 Which will divide $a$ by $2^b$, store the quotient in ``c'' and the remainder in ``d'. If $b \le 0$ then the
1066 ``polynomial basis''. This simply means a field element is stored by divisions of a radix. For example, if
1070 To multiply by the polynomial $g(x) = x$ all you have todo is shift the digits of the basis left one place. The
1078 This will multiply $a$ in place by $x^b$ which is equivalent to shifting the digits left $b$ places and inserting zeroes
1079 in the least significant digits. Similarly to divide by a power of $x$ the following function is provided.
1085 This will divide $a$ in place by $x^b$ and discard the remainder. This function cannot fail as it performs the operations
1145 This divides $a$ by $b$ and stores the quotient in $c$ and $d$. The signed quotient is computed such that
1159 should only be used with very large inputs. This is followed by the Karatsuba multiplications which are for moderate
1160 sized inputs. Then followed by the Comba and baseline multipliers.
1276 Modular reduction is process of taking the remainder of one quantity divided by another. Expressed
1277 as (\ref{eqn:mod}) the modular reduction is equivalent to the remainder of $b$ divided by $c$.
1299 of $b$. This algorithm accepts an input $a$ of any range and is not limited by $0 \le a < b^2$.
1411 example, to calculate $a^3 \mbox { mod }b$ using Montgomery reduction the value of $a$ can be normalized by
1412 multiplying it by $R$. Consider the following code snippet.
1553 This computes $c = a^b$ using a simple binary left-to-right algorithm. It is faster than repeated multiplications by
1568 moduli of the a ``restricted dimminished radix'' form lead to the fastest modular exponentiations. Followed by Montgomery
1594 This will attempt to evenly divide $a$ by a list of primes\footnote{Default is the first 256 primes.} and store the
1595 outcome in ``result''. That is if $result = 0$ then $a$ is not divisible by the primes, otherwise it is. Note that
1640 This will perform a trial division followed by $t$ rounds of Miller-Rabin tests on $a$ and store the result in $result$.
1641 If $a$ passes all of the tests $result$ is set to one, otherwise it is set to zero. Note that $t$ is bounded by
1642 $1 \le t < PRIME\_SIZE$ where $PRIME\_SIZE$ is the number of primes in the prime number table (by default this is $256$).
1714 by the conversion before storing any data use the following function.