~wattazoum/albert/albert-mod

« back to all changes in this revision

Viewing changes to Scalar_arithmetic.c

  • Committer: Oumar Aziz OUATTARA (alias wattazoum)
  • Date: 2008-09-04 22:03:37 UTC
  • Revision ID: oumar_aziz_ouattara_alias_wattazoum-20080904220337-5bbir8vdc784furf
fixed a lot of compile issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
/***      Arithmatic.                                            ***/
21
21
/*******************************************************************/
22
22
 
 
23
#include <stdlib.h>
 
24
#include <stdio.h>
 
25
#include <string.h>
23
26
#include "Build_defs.h"
 
27
#include "Scalar_arithmetic.h"
24
28
 
25
29
#define  PRIME_BOUND  256
26
30
 
27
31
#define Scalar_assert(x) \
28
 
    if ((x<0) || (x > Prime)) { \
 
32
    if ( x > Prime ) { \
29
33
        printf("WARNING: Scalar %d out of range.\n",x); \
30
34
        exit(1); \
31
35
     }
57
61
Scalar ConvertToScalar(i)
58
62
int i;
59
63
{
60
 
   Scalar S_minus();
61
 
 
62
64
   if (i > 0)
63
65
       return(i%Prime);
64
66
   else 
110
112
Scalar S_div(x,y)
111
113
Scalar x,y;
112
114
{
113
 
    Scalar S_mul();
114
 
    Scalar S_inv();
115
 
 
116
115
    Scalar_assert(x);
117
116
    Scalar_assert(y);
118
117