1/*
2Copyright (C) 1999-2007 The Botan Project. All rights reserved.
3
4Redistribution and use in source and binary forms, for any use, with or without
5modification, is permitted provided that the following conditions are met:
6
71. Redistributions of source code must retain the above copyright notice, this
8list of conditions, and the following disclaimer.
9
102. Redistributions in binary form must reproduce the above copyright notice,
11this list of conditions, and the following disclaimer in the documentation
12and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED
15WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
17
18IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT,
19INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*/
26// LICENSEHEADER_END
27namespace QCA { // WRAPNS_LINE
28/*************************************************
29 * MPI Algorithms Header File *
30 * (C) 1999-2007 The Botan Project *
31 *************************************************/
32
33#ifndef BOTAN_MP_CORE_H__
34#define BOTAN_MP_CORE_H__
35
36} // WRAPNS_LINE
37#include <botan/mp_types.h>
38namespace QCA { // WRAPNS_LINE
39
40namespace Botan {
41
42/*************************************************
43 * The size of the word type, in bits *
44 *************************************************/
45const u32bit MP_WORD_BITS = BOTAN_MP_WORD_BITS;
46
47extern "C" {
48
49/*************************************************
50 * Addition/Subtraction Operations *
51 *************************************************/
52void bigint_add2(word[], u32bit, const word[], u32bit);
53void bigint_add3(word[], const word[], u32bit, const word[], u32bit);
54
55word bigint_add2_nc(word[], u32bit, const word[], u32bit);
56word bigint_add3_nc(word[], const word[], u32bit, const word[], u32bit);
57
58void bigint_sub2(word[], u32bit, const word[], u32bit);
59void bigint_sub3(word[], const word[], u32bit, const word[], u32bit);
60
61/*************************************************
62 * Shift Operations *
63 *************************************************/
64void bigint_shl1(word[], u32bit, u32bit, u32bit);
65void bigint_shl2(word[], const word[], u32bit, u32bit, u32bit);
66void bigint_shr1(word[], u32bit, u32bit, u32bit);
67void bigint_shr2(word[], const word[], u32bit, u32bit, u32bit);
68
69/*************************************************
70 * Multiplication and Squaring Operations *
71 *************************************************/
72word bigint_mul_add_words(word[], const word[], u32bit, word);
73
74void bigint_linmul2(word[], u32bit, word);
75void bigint_linmul3(word[], const word[], u32bit, word);
76void bigint_linmul_add(word[], u32bit, const word[], u32bit, word);
77
78/*************************************************
79 * Montgomery Reduction *
80 *************************************************/
81void bigint_monty_redc(word[], u32bit, const word[], u32bit, word);
82
83/*************************************************
84 * Misc Utility Operations *
85 *************************************************/
86u32bit bigint_divcore(word, word, word, word, word, word);
87s32bit bigint_cmp(const word[], u32bit, const word[], u32bit);
88word bigint_divop(word, word, word);
89word bigint_modop(word, word, word);
90void bigint_wordmul(word, word, word *, word *);
91
92/*************************************************
93 * Comba Multiplication / Squaring *
94 *************************************************/
95void bigint_comba_mul4(word[8], const word[4], const word[4]);
96void bigint_comba_mul6(word[12], const word[6], const word[6]);
97void bigint_comba_mul8(word[16], const word[8], const word[8]);
98
99void bigint_comba_sqr4(word[8], const word[4]);
100void bigint_comba_sqr6(word[12], const word[6]);
101void bigint_comba_sqr8(word[16], const word[8]);
102}
103
104/*************************************************
105 * High Level Multiplication/Squaring Interfaces *
106 *************************************************/
107void bigint_mul(word[], u32bit, word[], const word[], u32bit, u32bit, const word[], u32bit, u32bit);
108
109void bigint_sqr(word[], u32bit, word[], const word[], u32bit, u32bit);
110
111}
112
113#endif
114} // WRAPNS_LINE
115

source code of qca/src/botantools/botan/botan/mp_core.h