A simple library to support serving https.
Dependents: oldheating gps motorhome heating
Diff: pki/pri-key.c
- Revision:
- 2:82268409e83f
- Parent:
- 1:9c66a551a67e
- Child:
- 4:6a1d887f1cad
diff -r 9c66a551a67e -r 82268409e83f pki/pri-key.c --- a/pki/pri-key.c Fri Jul 26 13:49:52 2019 +0000 +++ b/pki/pri-key.c Wed Jul 31 15:12:34 2019 +0000 @@ -118,14 +118,22 @@ LogBytesAsHex( dq, sizeof( dq)); Log("\n\n"); LogBytesAsHex(invq, sizeof(invq)); Log("\n\n"); } -void PriKeyDecryptStart(char* message, char* result) +int PriKeyDecryptStart(char* message) //return the slot number for the decryption { //Convert message to big number (little endian) format prior to decryption char leMessage[128]; for (int i = 0; i < 128; i++) leMessage[127 - i] = message[i]; - BnExpModStart((uint32_t*)leMessage, (uint32_t*)d, (uint32_t*)n, (uint32_t*)result); + return BnExpModStart((uint32_t*)leMessage, (uint32_t*)d, (uint32_t*)n); +} +bool PriKeyDecryptFinished(int slot) +{ + return BnExpModStatus[slot] == BIGNUM_CALC_FINISHED; } -bool PriKeyDecryptFinished() +char* PriKeyDecryptGetResult(int slot) { - return BnExpModStatus == BIGNUM_CALC_FINISHED; + return (char*) BnExpModGetResult(slot); +} +void PriKeyDecryptClear(int slot) +{ + BnExpModClear(slot); } \ No newline at end of file