Andrew Boyson / lpc1768

Dependents:   test-lpc1768 oldheating gps motorhome ... more

Revision:
55:975f706c67d2
Parent:
54:9b3b189bc82c
--- a/bignum/bignum.h	Wed Jun 19 15:34:17 2019 +0000
+++ b/bignum/bignum.h	Fri Jun 21 14:27:57 2019 +0000
@@ -4,25 +4,37 @@
 //Assembly instructions
 extern void BnZer2048(uint32_t* acc);
 extern void BnInc2048(uint32_t* acc);
-extern void BnShiftR2048(uint32_t* acc);
-extern void BnShiftL2048(uint32_t* acc);
+extern bool BnShr2048(uint32_t* acc, bool bitIn); //Returns bit shifted out
+extern bool BnShl2048(uint32_t* acc, bool bitIn); //Returns bit shifted out
 extern void BnCpy2048(uint32_t* acc, uint32_t* value);
 extern void BnOrr2048(uint32_t* acc, uint32_t* value);
 extern void BnAdd2048(uint32_t* acc, uint32_t* value);
 extern void BnSub2048(uint32_t* acc, uint32_t* value);
-extern bool BnIsEmpty2048           (uint32_t* value);
-extern bool BnIsNotEmpty2048        (uint32_t* value);
+extern bool BnIse2048               (uint32_t* value);
+extern bool BnIne2048               (uint32_t* value);
 extern int  BnCmp2048(uint32_t* lhs, uint32_t* rhs);
 
+extern void BnZer1024(uint32_t* acc);
+extern void BnInc1024(uint32_t* acc);
+extern bool BnShr1024(uint32_t* acc, bool bitIn); //Returns bit shifted out
+extern bool BnShl1024(uint32_t* acc, bool bitIn); //Returns bit shifted out
+extern void BnCpy1024(uint32_t* acc, uint32_t* value);
+extern void BnOrr1024(uint32_t* acc, uint32_t* value);
+extern void BnAdd1024(uint32_t* acc, uint32_t* value);
+extern void BnSub1024(uint32_t* acc, uint32_t* value);
+extern bool BnIse1024               (uint32_t* value);
+extern bool BnIne1024               (uint32_t* value);
+extern int  BnCmp1024(uint32_t* lhs, uint32_t* rhs);
+
 // Text functions
-extern void BnParseHex(uint32_t* n, const char* p);
-extern void BnAsHttp  (uint32_t* n);
+extern void BnParseHex2048(uint32_t* n, const char* p);
+extern void BnAsHttp2048  (uint32_t* n);
+extern void BnParseHex1024(uint32_t* n, const char* p);
+extern void BnAsHttp1024  (uint32_t* n);
 
 // Arithmetic operations
-extern void Bn1024Mul2048   (uint32_t* a1024, uint32_t* b1024, uint32_t* r2048);
-extern void BnDiv   (uint32_t* n, uint32_t* d, uint32_t* q             );
-extern void BnRem   (uint32_t* n, uint32_t* d,              uint32_t* r);
-extern void BnDivRem(uint32_t* n, uint32_t* d, uint32_t* q, uint32_t* r);
+extern void Bn1024Mul2048(uint32_t* a1024, uint32_t* b1024, uint32_t* r2048);
+extern void BnRem1024(int numSize, uint32_t* n, uint32_t* d1024, uint32_t* r1024);
 
 // Asynchronous operations
 #define BIGNUM_CALC_NONE     0