Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions 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
4 changes: 3 additions & 1 deletion 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 @@ -209,3 +209,5 @@ extern ZZn one(void);

#endif

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forward declaration should be moved before #endif.