0

I am trying to install MIRACL Library in my Macbook Air with M1 chip. I cloned the repository from https://github.com/miracl/MIRACL and followed the instructions from https://github.com/miracl/MIRACL/blob/master/docs/miracl-user-manual/installation.md

But when I run gcc –I. –c –O2 mr*.c , I get the following error.

mrarth1.c:56:10: fatal error: 'ieeefp.h' file not found
#include <ieeefp.h>
         ^~~~~~~~~~
1 error generated.
mrmonty.c:145:20: error: invalid operands to binary expression ('mr_small' (aka 'double') and 'int')
        if (n->w[n->len-1]>>M4 < 5) mr_mip->NO_CARRY=TRUE;
            ~~~~~~~~~~~~~~^ ~~
1 error generated.
mrmuldv.c:12:9: error: use of undeclared identifier '_asm'
        ASM mov   eax,DWORD PTR a      
        ^
mrmuldv.c:7:13: note: expanded from macro 'ASM'
#define ASM _asm
            ^
mrmuldv.c:24:9: error: use of undeclared identifier '_asm'
        ASM mov   edx,DWORD PTR a      
        ^
mrmuldv.c:7:13: note: expanded from macro 'ASM'
#define ASM _asm
            ^
mrmuldv.c:34:9: error: use of undeclared identifier '_asm'
        ASM mov   eax,DWORD PTR a      
        ^
mrmuldv.c:7:13: note: expanded from macro 'ASM'
#define ASM _asm
            ^
mrmuldv.c:46:9: error: use of undeclared identifier '_asm'
        ASM mov   eax,DWORD PTR a      
        ^
mrmuldv.c:7:13: note: expanded from macro 'ASM'
#define ASM _asm
            ^
4 errors generated.
mrstrong.c:164:11: error: invalid operands to binary expression ('mr_small' (aka 'double') and 'int')
                        r = (r << 8) ^ ran;
                             ~ ^  ~
mrstrong.c:167:49: error: implicitly declaring library function 'modf' with type 'double (double, double *)' [-Werror,-Wimplicit-function-declaration]
        else                 mr_mip->w1->w[m-1]=MR_REMAIN(r,mr_mip->base);
                                                ^
./miracl.h:275:35: note: expanded from macro 'MR_REMAIN'
  #define MR_REMAIN(a,b) ((a)-(b)*MR_DIV((a),(b)))
                                  ^
./miracl.h:264:27: note: expanded from macro 'MR_DIV'
  #define MR_DIV(a,b)    (modf((a)/(b),&dres),dres)
                          ^
mrstrong.c:167:49: note: include the header <math.h> or explicitly provide a declaration for 'modf'
./miracl.h:275:35: note: expanded from macro 'MR_REMAIN'
  #define MR_REMAIN(a,b) ((a)-(b)*MR_DIV((a),(b)))
                                  ^
./miracl.h:264:27: note: expanded from macro 'MR_DIV'
  #define MR_DIV(a,b)    (modf((a)/(b),&dres),dres)
                          ^
mrstrong.c:167:49: error: use of undeclared identifier 'dres'; did you mean 'nres'?
        else                 mr_mip->w1->w[m-1]=MR_REMAIN(r,mr_mip->base);
                                                ^
./miracl.h:275:35: note: expanded from macro 'MR_REMAIN'
  #define MR_REMAIN(a,b) ((a)-(b)*MR_DIV((a),(b)))
                                  ^
./miracl.h:264:41: note: expanded from macro 'MR_DIV'
  #define MR_DIV(a,b)    (modf((a)/(b),&dres),dres)
                                        ^
./miracl.h:1029:14: note: 'nres' declared here
extern void  nres(_MIPT_ big,big);        
             ^
mrstrong.c:167:49: error: use of undeclared identifier 'dres'; did you mean 'nres'?
        else                 mr_mip->w1->w[m-1]=MR_REMAIN(r,mr_mip->base);
                                                ^
./miracl.h:275:35: note: expanded from macro 'MR_REMAIN'
  #define MR_REMAIN(a,b) ((a)-(b)*MR_DIV((a),(b)))
                                  ^
./miracl.h:264:47: note: expanded from macro 'MR_DIV'
  #define MR_DIV(a,b)    (modf((a)/(b),&dres),dres)
                                              ^
./miracl.h:1029:14: note: 'nres' declared here
extern void  nres(_MIPT_ big,big);        
             ^
mrstrong.c:167:49: error: invalid operands to binary expression ('mr_small' (aka 'double') and 'void (*)(big, big)' (aka 'void (*)(struct bigtype *, struct bigtype *)'))
        else                 mr_mip->w1->w[m-1]=MR_REMAIN(r,mr_mip->base);
                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
./miracl.h:275:34: note: expanded from macro 'MR_REMAIN'
  #define MR_REMAIN(a,b) ((a)-(b)*MR_DIV((a),(b)))
                              ~~~^~~~~~~~~~~~~~~~
5 errors generated.

I am not able to find any proper information about ieeefp.h even after a thorough google search.

Please help me with this. Also my main aim is to measure how much time it takes for an ECC point addition and multiplication in my Macbook. So, any other libraries suggestion suitable for Macbook M1 chip will be appreciated.

Arivarasan
  • 285
  • 1
  • 7

0 Answers0