fork download
  1. #ifndef BIGLIB_H
  2. #define BIGLIB_H
  3.  
  4. typedef unsigned long DWORD;
  5. typedef unsigned long BIG;
  6.  
  7. /* creates a bignum and initializes it with the value InitValue
  8.  * returns a pointer to the bignum */
  9. extern DWORD __stdcall _BigCreate(DWORD InitValue);
  10.  
  11. /* destroys the bignum Big */
  12. extern DWORD __stdcall _BigDestroy(DWORD BigAddr);
  13.  
  14. /* copies BigSrc to BigDest */
  15. extern DWORD __stdcall _BigCopy(DWORD BigSrc, DWORD BigDest);
  16.  
  17. /* compares BigA and BigB
  18.  * returns 1 if BigA > BigB
  19.  * 0 if BigA = BigB
  20.  * -1 if BigA < BigB
  21.  */
  22. extern DWORD __stdcall _BigCompare(DWORD BigA, DWORD BigB);
  23.  
  24. /* compares BigA and 32-bit Value
  25.  * returns 1 if BigA > Value
  26.  * 0 if BigA = Value
  27.  * -1 if BigA < Value
  28.  */
  29. extern DWORD __stdcall _BigCompare32(DWORD BigA, DWORD Value);
  30.  
  31. /* fills Big with Len bytes of Data in base 256 */
  32. extern DWORD __stdcall _BigInB256(unsigned char *Data, DWORD Len, DWORD Big);
  33.  
  34. /* fills Big with 32-bit Value */
  35. extern DWORD __stdcall _BigIn32(DWORD Value, DWORD Big);
  36.  
  37. /* fills Big with the null-terminated string String in base Base (Base is 2-62)
  38.  * returns 0 if no error, -1 if base not supported */
  39. extern DWORD __stdcall _BigIn(unsigned char *string, DWORD base, DWORD big);
  40.  
  41. /* fills Big with Len bytes of data at Buffer in base Base (Base is 2-256)
  42. returns 0 if no error, -1 if base not supported */
  43. extern DWORD __stdcall _BigInBytes(unsigned char *buffer, DWORD Len, DWORD base, DWORD Big);
  44.  
  45. /* fills Buffer with the value of Big in base 256
  46.   returns the length of the string */
  47. extern DWORD __stdcall _BigOutB256(DWORD Big, unsigned char *buffer);
  48.  
  49. /* fills Buffer with the value of Big in base 16 as a null-terminated string
  50.   returns the length of the string not including the terminating null character */
  51. extern DWORD __stdcall _BigOutB16(DWORD Big, unsigned char *buffer);
  52.  
  53. /* fills Buffer with the value of Big in base Base as a null-terminated string (Base is 2-62 or 256)
  54.   returns the length of the string not including the terminating null character,
  55.   -1 if base not supported*/
  56. extern DWORD __stdcall _BigOut(DWORD big, DWORD base, unsigned char *buffer);
  57.  
  58. /* fills Buffer with the value of Big in base Base as data (Base is 2-256)
  59.   returns the length of the data not including the terminating null character,
  60.   -1 if base not supported */
  61. extern DWORD __stdcall _BigOutBytes(DWORD Big, DWORD dtBase, unsigned char *buffer);
  62.  
  63. /* BigY = BigX + Value */
  64. extern DWORD __stdcall _BigAdd32(DWORD BigX, DWORD Value, DWORD BigY);
  65.  
  66. /* BigZ = BigX + BigY */
  67. extern DWORD __stdcall _BigAdd(DWORD BigX, DWORD BigY, DWORD BigZ);
  68.  
  69. /* BigY = |BigX - Value| */
  70. extern DWORD __stdcall _BigSub32(DWORD BigX, DWORD Value, DWORD BigY);
  71.  
  72. /* BigZ = |BigX - BigY| */
  73. extern DWORD __stdcall _BigSub(DWORD BigX, DWORD BigY, DWORD BigZ);
  74.  
  75. /* BigY = BigX >> 1
  76.   returns the previous lower bit */
  77. extern DWORD __stdcall _BigShr(DWORD BigX, DWORD BigY);
  78.  
  79. /* BigY = BigX << 1 */
  80. extern DWORD __stdcall _BigShl(DWORD BigX, DWORD BigY);
  81.  
  82. /* BigY = BigX * Value */
  83. extern DWORD __stdcall _BigMul32(DWORD BigX, DWORD Value, DWORD BigY);
  84.  
  85. /* BigZ = BigX * BigY */
  86. extern DWORD __stdcall _BigMul(DWORD BigX, DWORD BigY, DWORD BigZ);
  87.  
  88. /* BigY = BigX / Value
  89. BigR = BigX mod Value
  90. if pointer to BigY is 0, only remainder is returned
  91. if pointer to BigR is 0, only quotient is returned
  92. returns remainder, -1 if division by zero
  93. */
  94. extern DWORD __stdcall _BigDiv32(DWORD BigX, DWORD Value, DWORD BigY, DWORD BigR);
  95.  
  96. /* BigZ = BigX / BigY
  97. BigR = BigX mod BigY
  98. if pointer to BigZ is 0, only remainder is returned
  99. if pointer to BigR is 0, only quotient is returned
  100. returns 0 if no error
  101. returns -1 if division by zero */
  102. extern DWORD __stdcall _BigDiv(DWORD BigX, DWORD BigY, DWORD BigZ, DWORD BigR);
  103.  
  104. /* BigZ = BigX mod BigY
  105. returns 0 if no error
  106. returns -1 if division by zero */
  107. extern DWORD __stdcall _BigMod(DWORD BigX, DWORD BigY, DWORD BigZ);
  108.  
  109. /* BigZ = BigX * BigY mod BigN
  110. returns 0 if no error
  111. returns -1 if division by zero */
  112. extern DWORD __stdcall _BigMulMod(DWORD BigX, DWORD BigY, DWORD BigN, DWORD BigZ);
  113.  
  114. /* BigZ = BigX ^ E mod BigN
  115. returns 0 if no error
  116. returns -1 if division by zero */
  117. extern DWORD __stdcall _BigPowMod32(DWORD BigX, DWORD E, DWORD BigN, DWORD BigZ);
  118.  
  119. /* BigZ = BigX ^ BigY mod BigN
  120. returns 0 if no error
  121. returns -1 if division by zero */
  122. extern DWORD __stdcall _BigPowMod(DWORD BigX, DWORD BigY, DWORD BigN, DWORD BigZ);
  123.  
  124. /* BigZ = g.c.d.(BigX, BigY) */
  125. extern DWORD __stdcall _BigGcd(DWORD BigX, DWORD BigY, DWORD BigZ);
  126.  
  127. #endif
  128.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:24: error: expected initializer before '_BigCreate'
 extern DWORD __stdcall _BigCreate(DWORD InitValue);
                        ^
prog.cpp:12:24: error: expected initializer before '_BigDestroy'
 extern DWORD __stdcall _BigDestroy(DWORD BigAddr);
                        ^
prog.cpp:15:24: error: expected initializer before '_BigCopy'
 extern DWORD __stdcall _BigCopy(DWORD BigSrc, DWORD BigDest);
                        ^
prog.cpp:22:24: error: expected initializer before '_BigCompare'
 extern DWORD __stdcall _BigCompare(DWORD BigA, DWORD BigB);
                        ^
prog.cpp:29:24: error: expected initializer before '_BigCompare32'
 extern DWORD __stdcall _BigCompare32(DWORD BigA, DWORD Value);
                        ^
prog.cpp:32:24: error: expected initializer before '_BigInB256'
 extern DWORD __stdcall _BigInB256(unsigned char *Data, DWORD Len, DWORD Big);
                        ^
prog.cpp:35:24: error: expected initializer before '_BigIn32'
 extern DWORD __stdcall _BigIn32(DWORD Value, DWORD Big);
                        ^
prog.cpp:39:24: error: expected initializer before '_BigIn'
 extern DWORD __stdcall _BigIn(unsigned char *string, DWORD base, DWORD big);
                        ^
prog.cpp:43:24: error: expected initializer before '_BigInBytes'
 extern DWORD __stdcall _BigInBytes(unsigned char *buffer, DWORD Len, DWORD base, DWORD Big);
                        ^
prog.cpp:47:24: error: expected initializer before '_BigOutB256'
 extern DWORD __stdcall _BigOutB256(DWORD Big, unsigned char *buffer);
                        ^
prog.cpp:51:24: error: expected initializer before '_BigOutB16'
 extern DWORD __stdcall _BigOutB16(DWORD Big, unsigned char *buffer);
                        ^
prog.cpp:56:24: error: expected initializer before '_BigOut'
 extern DWORD __stdcall _BigOut(DWORD big, DWORD base, unsigned char *buffer);
                        ^
prog.cpp:61:24: error: expected initializer before '_BigOutBytes'
 extern DWORD __stdcall _BigOutBytes(DWORD Big, DWORD dtBase, unsigned char *buffer);
                        ^
prog.cpp:64:24: error: expected initializer before '_BigAdd32'
 extern DWORD __stdcall _BigAdd32(DWORD BigX, DWORD Value, DWORD BigY);
                        ^
prog.cpp:67:24: error: expected initializer before '_BigAdd'
 extern DWORD __stdcall _BigAdd(DWORD BigX, DWORD BigY, DWORD BigZ);
                        ^
prog.cpp:70:24: error: expected initializer before '_BigSub32'
 extern DWORD __stdcall _BigSub32(DWORD BigX, DWORD Value, DWORD BigY);
                        ^
prog.cpp:73:24: error: expected initializer before '_BigSub'
 extern DWORD __stdcall _BigSub(DWORD BigX, DWORD BigY, DWORD BigZ);
                        ^
prog.cpp:77:24: error: expected initializer before '_BigShr'
 extern DWORD __stdcall _BigShr(DWORD BigX, DWORD BigY);
                        ^
prog.cpp:80:24: error: expected initializer before '_BigShl'
 extern DWORD __stdcall _BigShl(DWORD BigX, DWORD BigY);
                        ^
prog.cpp:83:24: error: expected initializer before '_BigMul32'
 extern DWORD __stdcall _BigMul32(DWORD BigX, DWORD Value, DWORD BigY);
                        ^
prog.cpp:86:24: error: expected initializer before '_BigMul'
 extern DWORD __stdcall _BigMul(DWORD BigX, DWORD BigY, DWORD BigZ);
                        ^
prog.cpp:94:24: error: expected initializer before '_BigDiv32'
 extern DWORD __stdcall _BigDiv32(DWORD BigX, DWORD Value, DWORD BigY, DWORD BigR);
                        ^
prog.cpp:102:24: error: expected initializer before '_BigDiv'
 extern DWORD __stdcall _BigDiv(DWORD BigX, DWORD BigY, DWORD BigZ, DWORD BigR);
                        ^
prog.cpp:107:24: error: expected initializer before '_BigMod'
 extern DWORD __stdcall _BigMod(DWORD BigX, DWORD BigY, DWORD BigZ);
                        ^
prog.cpp:112:24: error: expected initializer before '_BigMulMod'
 extern DWORD __stdcall _BigMulMod(DWORD BigX, DWORD BigY, DWORD BigN, DWORD BigZ);
                        ^
prog.cpp:117:24: error: expected initializer before '_BigPowMod32'
 extern DWORD __stdcall _BigPowMod32(DWORD BigX, DWORD E, DWORD BigN, DWORD BigZ);
                        ^
prog.cpp:122:24: error: expected initializer before '_BigPowMod'
 extern DWORD __stdcall _BigPowMod(DWORD BigX, DWORD BigY, DWORD BigN, DWORD BigZ);
                        ^
prog.cpp:125:24: error: expected initializer before '_BigGcd'
 extern DWORD __stdcall _BigGcd(DWORD BigX, DWORD BigY, DWORD BigZ);
                        ^
stdout
Standard output is empty