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
Diff: bignum/bignum.h
- Revision:
- 61:d4fc276a824e
- Parent:
- 60:b4f337685ec4
--- a/bignum/bignum.h Tue Sep 24 18:15:09 2019 +0000 +++ b/bignum/bignum.h Thu Sep 26 07:20:30 2019 +0000 @@ -26,6 +26,18 @@ extern bool BnIne1024( uint32_t* value); extern int BnCmp1024(uint32_t* lhs, uint32_t* rhs); +extern void BnZer512 (uint32_t* acc); +extern void BnInc512 (uint32_t* acc); +extern bool BnShr512 (uint32_t* acc, bool bitIn); //Returns bit shifted out +extern bool BnShl512 (uint32_t* acc, bool bitIn); //Returns bit shifted out +extern void BnCpy512 (uint32_t* acc, uint32_t* value); +extern void BnOrr512 (uint32_t* acc, uint32_t* value); +extern void BnAdd512 (uint32_t* acc, uint32_t* value); +extern void BnSub512 (uint32_t* acc, uint32_t* value); +extern bool BnIse512 ( uint32_t* value); +extern bool BnIne512 ( uint32_t* value); +extern int BnCmp512 (uint32_t* lhs, uint32_t* rhs); + // Text functions extern void BnParseHex2048(uint32_t* n, const char* p); extern void BnAsHttp2048 (uint32_t* n); @@ -36,7 +48,12 @@ 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); +extern void Bn512Mul1024(uint32_t* a512, uint32_t* b512, uint32_t* r1024); +extern void BnRem512(int numSize, uint32_t* n, uint32_t* d512, uint32_t* r512); + //Asynchronous operations -extern void BnModExpStart1024 (uint32_t m[32], uint32_t e[32], uint32_t n[32], uint32_t r[32], uint32_t* message, uint32_t* exponent, uint32_t* modulus); +extern void BnModExpStart1024 (uint32_t m[32], uint32_t e[32], uint32_t n[32], uint32_t r[32], int messageSize, uint32_t* message, uint32_t* exponent, uint32_t* modulus); extern bool BnModExpIterate1024(uint32_t m[32], uint32_t e[32], uint32_t n[32], uint32_t r[32]); //Returns true if finished +extern void BnModExpStart512 (uint32_t m[16], uint32_t e[16], uint32_t n[16], uint32_t r[16], int messageSize, uint32_t* message, uint32_t* exponent, uint32_t* modulus); +extern bool BnModExpIterate512 (uint32_t m[16], uint32_t e[16], uint32_t n[16], uint32_t r[16]); //Returns true if finished