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-19
- Revision:
- 54:9b3b189bc82c
- Parent:
- 53:3888bf121010
- Child:
- 55:975f706c67d2
File content as of revision 54:9b3b189bc82c:
#include <stdint.h> #include <stdbool.h> //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 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 int BnCmp2048(uint32_t* lhs, uint32_t* rhs); // Text functions extern void BnParseHex(uint32_t* n, const char* p); extern void BnAsHttp (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); // 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);