Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: test-lpc1768 oldheating gps motorhome ... more
bignum/bignum.h
- Committer:
- andrewboyson
- Date:
- 2019-06-21
- Revision:
- 55:975f706c67d2
- Parent:
- 54:9b3b189bc82c
File content as of revision 55:975f706c67d2:
#include <stdint.h> #include <stdbool.h> //Assembly instructions extern void BnZer2048(uint32_t* acc); extern void BnInc2048(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 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 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 BnRem1024(int numSize, uint32_t* n, uint32_t* d1024, uint32_t* r1024); // Asynchronous operations #define BIGNUM_CALC_NONE 0 #define BIGNUM_CALC_STARTED 1 #define BIGNUM_CALC_FINISHED 2 extern void BnAsyncMain(void); extern int BnExpModStatus; extern int BnExpModProgress; extern uint64_t BnMulHr; extern uint64_t BnModHr; extern void BnExpModStart(uint32_t* message, uint32_t* exponent, uint32_t* modulus, uint32_t* result);