A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

Revision:
17:93feb2a51d58
Parent:
14:03a0b8fd6ddc
Child:
21:a6d6e26dd742
--- a/pki/pri-key.c	Sun Oct 06 08:00:30 2019 +0000
+++ b/pki/pri-key.c	Thu Oct 10 07:38:13 2019 +0000
@@ -131,10 +131,16 @@
 {
     return RsaFinished(slot);
 }
-uint8_t* PriKeyDecryptResult(int slot)
+uint8_t* PriKeyDecryptResultLittleEndian(int slot)
 {
     return (uint8_t*) RsaResult(slot);
 }
+void PriKeyDecryptResultTail(int slot, int length, uint8_t* pBuffer)
+{
+    //Convert result from big number (little endian) format after decryption
+    uint8_t* pLittleEndian = (uint8_t*) RsaResult(slot);
+    for (int i = 0; i < length; i++) *(pBuffer + i) = *(pLittleEndian + length - 1 - i);
+}
 void PriKeyDecryptClear(int slot)
 {
     RsaClear(slot);