added the securememory simulator_recovery code by @Roel et al

This commit is contained in:
iceman1001 2020-08-19 15:24:32 +02:00
commit 073e79553e
13 changed files with 3062 additions and 0 deletions

23
tools/cryptorf/util.c Normal file
View file

@ -0,0 +1,23 @@
#include "util.h"
#include <stdio.h>
void num_to_bytes(uint64_t n, size_t len, byte_t* dst)
{
while (len--)
{
dst[len] = (byte_t)n;
n >>= 8;
}
}
void print_bytes(const byte_t* pbtData, const size_t szLen) {
size_t uiPos;
for (uiPos=0; uiPos < szLen; uiPos++) {
printf("%02x ",pbtData[uiPos]);
if (uiPos>20){
printf("...");
break;
}
}
printf("\n");
}