Skip to content

Commit

Permalink
Merge pull request #22 from fabrice102/miracl-mac-fix
Browse files Browse the repository at this point in the history
Merge pull request miracl/MIRACL#7
  • Loading branch information
liorko87 authored Jul 30, 2017
2 parents c67adb8 + e9885e2 commit 6b97c82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 10 additions & 5 deletions lib/Miracl/include/big.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class Big
{if (mr_compare(b1.fn,b2.fn)>0) return TRUE; else return FALSE;}

friend Big from_binary(int,char *);
friend int to_binary(const Big&,int,char *,BOOL justify=FALSE);
friend int to_binary(const Big&,int,char *,BOOL);
friend Big modmult(const Big&,const Big&,const Big&);
friend Big mad(const Big&,const Big&,const Big&,const Big&,Big&);
friend Big norm(const Big&);
Expand All @@ -321,7 +321,7 @@ class Big
// x^m.y^k mod n
friend Big pow(int,Big *,Big *,Big); // x[0]^m[0].x[1].m[1]... mod n

friend Big luc(const Big& ,const Big&, const Big&, Big *b4=NULL);
friend Big luc(const Big& ,const Big&, const Big&, Big *);
friend Big moddiv(const Big&,const Big&,const Big&);
friend Big inverse(const Big&, const Big&);
friend void multi_inverse(int,Big*,const Big&,Big *);
Expand Down Expand Up @@ -353,8 +353,8 @@ class Big
friend void modulo(const Big&);
friend BOOL modulo(int,int,int,int,BOOL);
friend Big get_modulus(void);
friend int window(const Big&,int,int*,int*,int window_size=5);
friend int naf_window(const Big&,const Big&,int,int*,int*,int store=11);
friend int window(const Big&,int,int*,int*,int);
friend int naf_window(const Big&,const Big&,int,int*,int*,int);
friend void jsf(const Big&,const Big&,Big&,Big&,Big&,Big&);

/* Montgomery stuff */
Expand Down Expand Up @@ -420,7 +420,12 @@ extern Big get_modulus(void);
extern Big rand(int,int);
extern Big strong_rand(csprng *,int,int);
extern Big from_binary(int,char *);
extern int to_binary(const Big&,int,char *,BOOL);
extern int to_binary(const Big&,int,char *,BOOL justify=FALSE);

// Forward Declaration for friend declaration to allow definition in cpp.
int window(const Big& x,int i,int *nbs,int *nzs,int window_size=5);
int naf_window(const Big& x,const Big& x3,int i,int *nbs,int *nzs,int store=11);
Big luc(const Big& b1,const Big& b2,const Big& b3,Big *b4=NULL);

using namespace std;

Expand Down
7 changes: 5 additions & 2 deletions lib/Miracl/include/zzn.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class ZZn
friend ZZn getB(void); // get B parameter of elliptic curve

friend ZZn sqrt(const ZZn&); // only works if modulus is prime
friend ZZn luc( const ZZn&, const Big&, ZZn* b3=NULL);
friend ZZn luc( const ZZn&, const Big&, ZZn*);

big getzzn(void) const;

Expand All @@ -200,6 +200,10 @@ class ZZn
#endif
}
};

// Forward Declaration for friend declaration to allow definition in cpp.
ZZn luc(const ZZn&, const Big&, ZZn* b3=NULL);

#ifndef MR_NO_RAND
extern ZZn randn(void);
#endif
Expand All @@ -208,4 +212,3 @@ extern ZZn getB(void);
extern ZZn one(void);

#endif

0 comments on commit 6b97c82

Please sign in to comment.