Make changes for Halifax

This commit is contained in:
Val 2023-01-09 01:39:54 -06:00
parent 564e87f028
commit a023987aae
5 changed files with 50 additions and 22 deletions

View File

@ -1,4 +1,4 @@
# +-------------+---------+-----------------------+ # +-----------------------------------------------+
# | Created 2022-04-23 | # | Created 2022-04-23 |
# +-----------------------------------------------+ # +-----------------------------------------------+
@ -27,7 +27,7 @@ IncludeBlocks: Regroup
# Allow short blocks on single line # Allow short blocks on single line
AllowShortBlocksOnASingleLine: Always AllowShortBlocksOnASingleLine: Always
AllowShortEnumsOnASingleLine: false AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: AllIfsAndElse AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLambdasOnASingleLine: Inline AllowShortLambdasOnASingleLine: Inline

View File

@ -37,7 +37,6 @@ inv_sbox = [
for key in keys: for key in keys:
key = bytes.fromhex(key) key = bytes.fromhex(key)
cipher = Cipher(algorithms.AES128(key), modes.ECB()); cipher = Cipher(algorithms.AES128(key), modes.ECB());
enc = cipher.encryptor() enc = cipher.encryptor()

View File

@ -5,7 +5,24 @@
#include <string.h> #include <string.h>
#include "mem.h" #include "mem.h"
// 512 600 0011 // 512 600 0011
void INT (int arg, ...);
int flag_enable_0x7f = 1;
void INT (int arg, ...) {
switch (arg) {
case 0x40:
flag_enable_0x7f = 0;
break;
case 0x7f:
if(flag_enable_0x7f) {
printf("The lock is now open.\n");
exit(0);
}
break;
default:
printf("INT(0x%02x, ...) unimplemented", arg);
}
}
char hascii(int i) { char hascii(int i) {
if (i > '9') if (i > '9')

View File

@ -4,14 +4,23 @@
#include <stdlib.h> #include <stdlib.h>
#include "mem.h" #include "mem.h"
int verify_ed25519 (char * ed25519_pubkey, void * buf, int size, char * signature) {return 1;}; //* 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;
}
int sha256_internal (size_t sram_in_buf, size_t size, char * out_buf) {
INT(0x41, sram_in_buf, size, out_buf);
return 0;
}
//* functions that are explicitly implemented in the standard library
//void *memcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n); //void *memcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n);
//int memcmp(const void *__s1, const void *__s2, size_t __n); //int memcmp(const void *__s1, const void *__s2, size_t __n);
void sha1 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
void sha1 (void *buf,size_t size, char * out_buf) {} void sha256 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
void sha256 (void *buf,size_t size, char * out_buf) {} void sha512 (void *buf,size_t size, char * out_buf) {/* implementation goes here */}
void sha512 (void *buf,size_t size, char * out_buf) {}
#endif // __uC_LIB_C__ #endif // __uC_LIB_C__

View File

@ -44,3 +44,6 @@ Hopefully in the coming weeks I'll learn enough about malloc and free to get som
### 2022 Dec 11 PM: ### 2022 Dec 11 PM:
St. John's St. John's
Baku Baku
### 2022 Dec 12 PM - Ongoing
Halifax