monotone

monotone Mtn Source Tree

Root/botan/mp_core.h

1/*************************************************
2* MPI Algorithms Header File *
3* (C) 1999-2006 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
18extern "C" {
19
20/*************************************************
21* Addition/Subtraction Operations *
22*************************************************/
23void bigint_add2(word[], u32bit, const word[], u32bit);
24void bigint_add3(word[], const word[], u32bit, const word[], u32bit);
25
26word bigint_add2_nc(word[], u32bit, const word[], u32bit);
27word bigint_add3_nc(word[], const word[], u32bit, const word[], u32bit);
28
29void bigint_sub2(word[], u32bit, const word[], u32bit);
30void bigint_sub3(word[], const word[], u32bit, const word[], u32bit);
31
32/*************************************************
33* Shift Operations *
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* Multiplication and Squaring Operations *
42*************************************************/
43word bigint_mul_add_words(word[], const word[], u32bit, word);
44
45void bigint_linmul2(word[], u32bit, word);
46void bigint_linmul3(word[], const word[], u32bit, word);
47void bigint_linmul_add(word[], u32bit, const word[], u32bit, word);
48
49/*************************************************
50* Montgomery Reduction *
51*************************************************/
52void bigint_monty_redc(word[], u32bit, const word[], u32bit, word);
53
54/*************************************************
55* Misc Utility Operations *
56*************************************************/
57u32bit bigint_divcore(word, word, word, word, word, word);
58s32bit bigint_cmp(const word[], u32bit, const word[], u32bit);
59word bigint_divop(word, word, word);
60word bigint_modop(word, word, word);
61void bigint_wordmul(word, word, word*, word*);
62
63/*************************************************
64* Comba Multiplication / Squaring *
65*************************************************/
66void bigint_comba_mul4(word[8], const word[4], const word[4]);
67void bigint_comba_mul6(word[12], const word[6], const word[6]);
68void bigint_comba_mul8(word[16], const word[8], const word[8]);
69
70void bigint_comba_sqr4(word[8], const word[4]);
71void bigint_comba_sqr6(word[12], const word[6]);
72void bigint_comba_sqr8(word[16], const word[8]);
73
74}
75
76/*************************************************
77* High Level Multiplication/Squaring Interfaces *
78*************************************************/
79void bigint_mul(word[], u32bit, word[],
80 const word[], u32bit, u32bit,
81 const word[], u32bit, u32bit);
82
83void bigint_sqr(word[], u32bit, word[],
84 const word[], u32bit, u32bit);
85
86}
87
88#endif

Archive Download this file

Branches

Tags

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