xref: /dflybsd-src/contrib/gmp/mp_minv_tab.c (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /* A table of data supporting binvert_limb().
286d7f5d3SJohn Marino 
386d7f5d3SJohn Marino    THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND MAY CHANGE
486d7f5d3SJohn Marino    INCOMPATIBLY OR DISAPPEAR IN A FUTURE GNU MP RELEASE.  */
586d7f5d3SJohn Marino 
686d7f5d3SJohn Marino /*
786d7f5d3SJohn Marino Copyright 2000 Free Software Foundation, Inc.
886d7f5d3SJohn Marino 
986d7f5d3SJohn Marino This file is part of the GNU MP Library.
1086d7f5d3SJohn Marino 
1186d7f5d3SJohn Marino The GNU MP Library is free software; you can redistribute it and/or modify
1286d7f5d3SJohn Marino it under the terms of the GNU Lesser General Public License as published by
1386d7f5d3SJohn Marino the Free Software Foundation; either version 3 of the License, or (at your
1486d7f5d3SJohn Marino option) any later version.
1586d7f5d3SJohn Marino 
1686d7f5d3SJohn Marino The GNU MP Library is distributed in the hope that it will be useful, but
1786d7f5d3SJohn Marino WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1886d7f5d3SJohn Marino or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
1986d7f5d3SJohn Marino License for more details.
2086d7f5d3SJohn Marino 
2186d7f5d3SJohn Marino You should have received a copy of the GNU Lesser General Public License
2286d7f5d3SJohn Marino along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
2386d7f5d3SJohn Marino 
2486d7f5d3SJohn Marino #include "gmp.h"
2586d7f5d3SJohn Marino #include "gmp-impl.h"
2686d7f5d3SJohn Marino 
2786d7f5d3SJohn Marino 
2886d7f5d3SJohn Marino /* binvert_limb_table[i] is the multiplicative inverse of 2*i+1 mod 256,
2986d7f5d3SJohn Marino    ie. (binvert_limb_table[i] * (2*i+1)) % 256 == 1 */
3086d7f5d3SJohn Marino 
3186d7f5d3SJohn Marino const unsigned char  binvert_limb_table[128] = {
3286d7f5d3SJohn Marino   0x01, 0xAB, 0xCD, 0xB7, 0x39, 0xA3, 0xC5, 0xEF,
3386d7f5d3SJohn Marino   0xF1, 0x1B, 0x3D, 0xA7, 0x29, 0x13, 0x35, 0xDF,
3486d7f5d3SJohn Marino   0xE1, 0x8B, 0xAD, 0x97, 0x19, 0x83, 0xA5, 0xCF,
3586d7f5d3SJohn Marino   0xD1, 0xFB, 0x1D, 0x87, 0x09, 0xF3, 0x15, 0xBF,
3686d7f5d3SJohn Marino   0xC1, 0x6B, 0x8D, 0x77, 0xF9, 0x63, 0x85, 0xAF,
3786d7f5d3SJohn Marino   0xB1, 0xDB, 0xFD, 0x67, 0xE9, 0xD3, 0xF5, 0x9F,
3886d7f5d3SJohn Marino   0xA1, 0x4B, 0x6D, 0x57, 0xD9, 0x43, 0x65, 0x8F,
3986d7f5d3SJohn Marino   0x91, 0xBB, 0xDD, 0x47, 0xC9, 0xB3, 0xD5, 0x7F,
4086d7f5d3SJohn Marino   0x81, 0x2B, 0x4D, 0x37, 0xB9, 0x23, 0x45, 0x6F,
4186d7f5d3SJohn Marino   0x71, 0x9B, 0xBD, 0x27, 0xA9, 0x93, 0xB5, 0x5F,
4286d7f5d3SJohn Marino   0x61, 0x0B, 0x2D, 0x17, 0x99, 0x03, 0x25, 0x4F,
4386d7f5d3SJohn Marino   0x51, 0x7B, 0x9D, 0x07, 0x89, 0x73, 0x95, 0x3F,
4486d7f5d3SJohn Marino   0x41, 0xEB, 0x0D, 0xF7, 0x79, 0xE3, 0x05, 0x2F,
4586d7f5d3SJohn Marino   0x31, 0x5B, 0x7D, 0xE7, 0x69, 0x53, 0x75, 0x1F,
4686d7f5d3SJohn Marino   0x21, 0xCB, 0xED, 0xD7, 0x59, 0xC3, 0xE5, 0x0F,
4786d7f5d3SJohn Marino   0x11, 0x3B, 0x5D, 0xC7, 0x49, 0x33, 0x55, 0xFF
4886d7f5d3SJohn Marino };
49