jdk/src/share/native/sun/security/ec/impl/mp_gf2m.c

Print this page




  34  * the Initial Developer. All Rights Reserved.
  35  *
  36  * Contributor(s):
  37  *   Sheueling Chang Shantz <sheueling.chang@sun.com> and
  38  *   Douglas Stebila <douglas@stebila.ca> of Sun Laboratories.
  39  *
  40  * Alternatively, the contents of this file may be used under the terms of
  41  * either the GNU General Public License Version 2 or later (the "GPL"), or
  42  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  43  * in which case the provisions of the GPL or the LGPL are applicable instead
  44  * of those above. If you wish to allow use of your version of this file only
  45  * under the terms of either the GPL or the LGPL, and not to allow others to
  46  * use your version of this file under the terms of the MPL, indicate your
  47  * decision by deleting the provisions above and replace them with the notice
  48  * and other provisions required by the GPL or the LGPL. If you do not delete
  49  * the provisions above, a recipient may use your version of this file under
  50  * the terms of any one of the MPL, the GPL or the LGPL.
  51  *
  52  *********************************************************************** */
  53 /*
  54  * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
  55  * Use is subject to license terms.
  56  */
  57 
  58 #include "mp_gf2m.h"
  59 #include "mp_gf2m-priv.h"
  60 #include "mplogic.h"
  61 #include "mpi-priv.h"
  62 
  63 const mp_digit mp_gf2m_sqr_tb[16] =
  64 {
  65       0,     1,     4,     5,    16,    17,    20,    21,
  66      64,    65,    68,    69,    80,    81,    84,    85
  67 };
  68 
  69 /* Multiply two binary polynomials mp_digits a, b.
  70  * Result is a polynomial with degree < 2 * MP_DIGIT_BITS - 1.
  71  * Output in two mp_digits rh, rl.
  72  */
  73 #if MP_DIGIT_BITS == 32
  74 void




  34  * the Initial Developer. All Rights Reserved.
  35  *
  36  * Contributor(s):
  37  *   Sheueling Chang Shantz <sheueling.chang@sun.com> and
  38  *   Douglas Stebila <douglas@stebila.ca> of Sun Laboratories.
  39  *
  40  * Alternatively, the contents of this file may be used under the terms of
  41  * either the GNU General Public License Version 2 or later (the "GPL"), or
  42  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  43  * in which case the provisions of the GPL or the LGPL are applicable instead
  44  * of those above. If you wish to allow use of your version of this file only
  45  * under the terms of either the GPL or the LGPL, and not to allow others to
  46  * use your version of this file under the terms of the MPL, indicate your
  47  * decision by deleting the provisions above and replace them with the notice
  48  * and other provisions required by the GPL or the LGPL. If you do not delete
  49  * the provisions above, a recipient may use your version of this file under
  50  * the terms of any one of the MPL, the GPL or the LGPL.
  51  *
  52  *********************************************************************** */
  53 /*
  54  * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  55  * Use is subject to license terms.
  56  */
  57 
  58 #include "mp_gf2m.h"
  59 #include "mp_gf2m-priv.h"
  60 #include "mplogic.h"
  61 #include "mpi-priv.h"
  62 
  63 const mp_digit mp_gf2m_sqr_tb[16] =
  64 {
  65       0,     1,     4,     5,    16,    17,    20,    21,
  66      64,    65,    68,    69,    80,    81,    84,    85
  67 };
  68 
  69 /* Multiply two binary polynomials mp_digits a, b.
  70  * Result is a polynomial with degree < 2 * MP_DIGIT_BITS - 1.
  71  * Output in two mp_digits rh, rl.
  72  */
  73 #if MP_DIGIT_BITS == 32
  74 void