monotone

monotone Mtn Source Tree

Root/botan/mp_core.h

1/*************************************************
2* MPI Algorithms Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_MP_CORE_H__
7#define BOTAN_MP_CORE_H__
8
9#include <botan/mp_types.h>
10
11namespace Botan {
12
13/*************************************************
14* The size of the word type, in bits *
15*************************************************/
16const u32bit MP_WORD_BITS = BOTAN_MP_WORD_BITS;
17
18/*************************************************
19* Two Argument MP Core *
20*************************************************/
21void bigint_add2(word[], u32bit, const word[], u32bit);
22void bigint_sub2(word[], u32bit, const word[], u32bit);
23void bigint_linmul2(word[], u32bit, word);
24
25/*************************************************
26* Three Argument MP Core *
27*************************************************/
28void bigint_add3(word[], const word[], u32bit, const word[], u32bit);
29void bigint_sub3(word[] , const word[], u32bit, const word[], u32bit);
30void bigint_linmul3(word[], const word[], u32bit, word);
31
32/*************************************************
33* MP Shifting *
34*************************************************/
35void bigint_shl1(word[], u32bit, u32bit, u32bit);
36void bigint_shl2(word[], const word[], u32bit, u32bit, u32bit);
37void bigint_shr1(word[], u32bit, u32bit, u32bit);
38void bigint_shr2(word[], const word[], u32bit, u32bit, u32bit);
39
40/*************************************************
41* Comba Multiplication *
42*************************************************/
43void bigint_comba4(word[8], const word[4], const word[4]);
44void bigint_comba6(word[12], const word[6], const word[6]);
45void bigint_comba8(word[16], const word[8], const word[8]);
46
47/*************************************************
48* Karatsuba Multiplication *
49*************************************************/
50void bigint_karat16(word[32], const word[16], const word[16]);
51void bigint_karat32(word[64], const word[32], const word[32]);
52void bigint_karat64(word[128], const word[64], const word[64]);
53void bigint_karat128(word[256], const word[128], const word[128]);
54
55void bigint_karat12(word[24], const word[12], const word[12]);
56void bigint_karat24(word[48], const word[24], const word[24]);
57void bigint_karat48(word[96], const word[48], const word[48]);
58void bigint_karat96(word[192], const word[96], const word[96]);
59
60/*************************************************
61* Simple O(N^2) Multiplication *
62*************************************************/
63void bigint_smul(word[], const word[], u32bit, const word[], u32bit);
64
65/*************************************************
66* MP Multiplication *
67*************************************************/
68void bigint_mul3(word[], u32bit, const word[], u32bit, u32bit,
69 const word[], u32bit, u32bit);
70
71/*************************************************
72* Misc MP Algorithms *
73*************************************************/
74u32bit bigint_divcore(word, word, word, word, word, word);
75s32bit bigint_cmp(const word[], u32bit, const word[], u32bit);
76word bigint_divop(word, word, word);
77word bigint_modop(word, word, word);
78void bigint_wordmul(word, word, word*, word*);
79
80}
81
82#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status