MicroCorruption/common/lib.c

27 lines
1004 B
C
Raw Normal View History

2022-12-12 03:03:53 +00:00
#ifndef __uC_LIB_C__
#define __uC_LIB_C__
#include <stdlib.h>
#include "mem.h"
2023-01-09 07:39:54 +00:00
//* functions that rely on hardware components of the Lockitall lock
int verify_ed25519 (char * ed25519_pubkey, void * buf, int size, char * signature) {
//FIXME: This is not correct (see ../22-Churchill/churchill.asm)
INT(0x33, ed25519_pubkey, buf, size, signature);
return 1;
}
2022-12-12 03:03:53 +00:00
2023-01-09 07:39:54 +00:00
int sha256_internal (size_t sram_in_buf, size_t size, char * out_buf) {
INT(0x41, sram_in_buf, size, out_buf);
return 0;
}
2022-12-12 03:03:53 +00:00
2023-01-09 07:39:54 +00:00
//* functions that are explicitly implemented in the standard library
2022-12-12 03:03:53 +00:00
//void *memcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n);
//int memcmp(const void *__s1, const void *__s2, size_t __n);
2023-01-09 07:39:54 +00:00
void sha1 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
void sha256 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
void sha512 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
2022-12-12 03:03:53 +00:00
#endif // __uC_LIB_C__