annotate src/share/native/sun/security/ec/impl/mpprime.h @ 4272:b49a0af85821

7049173: Replace the software license for ECC native code Reviewed-by: alanb
author vinnie
date Mon, 30 May 2011 16:37:42 +0100
parents 272483f6650b
children
rev   line source
vinnie@4272 1 /*
vinnie@4272 2 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
vinnie@4272 3 * Use is subject to license terms.
vinnie@4272 4 *
vinnie@4272 5 * This library is free software; you can redistribute it and/or
vinnie@4272 6 * modify it under the terms of the GNU Lesser General Public
vinnie@4272 7 * License as published by the Free Software Foundation; either
vinnie@4272 8 * version 2.1 of the License, or (at your option) any later version.
vinnie@4272 9 *
vinnie@4272 10 * This library is distributed in the hope that it will be useful,
vinnie@4272 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
vinnie@4272 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
vinnie@4272 13 * Lesser General Public License for more details.
vinnie@4272 14 *
vinnie@4272 15 * You should have received a copy of the GNU Lesser General Public License
vinnie@4272 16 * along with this library; if not, write to the Free Software Foundation,
vinnie@4272 17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
vinnie@4272 18 *
vinnie@4272 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
vinnie@4272 20 * or visit www.oracle.com if you need additional information or have any
vinnie@4272 21 * questions.
vinnie@4272 22 */
vinnie@4272 23
vinnie@1674 24 /* *********************************************************************
vinnie@1674 25 *
vinnie@1674 26 * The Original Code is the MPI Arbitrary Precision Integer Arithmetic library.
vinnie@1674 27 *
vinnie@1674 28 * The Initial Developer of the Original Code is
vinnie@1674 29 * Michael J. Fromberger.
vinnie@1674 30 * Portions created by the Initial Developer are Copyright (C) 1997
vinnie@1674 31 * the Initial Developer. All Rights Reserved.
vinnie@1674 32 *
vinnie@1674 33 * Contributor(s):
vinnie@1674 34 *
vinnie@1674 35 *********************************************************************** */
vinnie@4272 36
vinnie@4272 37 /* Utilities for finding and working with prime and pseudo-prime integers */
vinnie@1674 38
vinnie@1674 39 #ifndef _MP_PRIME_H
vinnie@1674 40 #define _MP_PRIME_H
vinnie@1674 41
vinnie@1674 42 #include "mpi.h"
vinnie@1674 43
vinnie@1674 44 extern const int prime_tab_size; /* number of primes available */
vinnie@1674 45 extern const mp_digit prime_tab[];
vinnie@1674 46
vinnie@1674 47 /* Tests for divisibility */
vinnie@1674 48 mp_err mpp_divis(mp_int *a, mp_int *b);
vinnie@1674 49 mp_err mpp_divis_d(mp_int *a, mp_digit d);
vinnie@1674 50
vinnie@1674 51 /* Random selection */
vinnie@1674 52 mp_err mpp_random(mp_int *a);
vinnie@1674 53 mp_err mpp_random_size(mp_int *a, mp_size prec);
vinnie@1674 54
vinnie@1674 55 /* Pseudo-primality testing */
vinnie@1674 56 mp_err mpp_divis_vector(mp_int *a, const mp_digit *vec, int size, int *which);
vinnie@1674 57 mp_err mpp_divis_primes(mp_int *a, mp_digit *np);
vinnie@1674 58 mp_err mpp_fermat(mp_int *a, mp_digit w);
vinnie@1674 59 mp_err mpp_fermat_list(mp_int *a, const mp_digit *primes, mp_size nPrimes);
vinnie@1674 60 mp_err mpp_pprime(mp_int *a, int nt);
vinnie@1674 61 mp_err mpp_sieve(mp_int *trial, const mp_digit *primes, mp_size nPrimes,
vinnie@1674 62 unsigned char *sieve, mp_size nSieve);
vinnie@1674 63 mp_err mpp_make_prime(mp_int *start, mp_size nBits, mp_size strong,
vinnie@1674 64 unsigned long * nTries);
vinnie@1674 65
vinnie@1674 66 #endif /* _MP_PRIME_H */