mirror of
https://git.soft.fish/val/MicroCorruption.git
synced 2024-11-21 21:05:59 +00:00
Make changes for Halifax
This commit is contained in:
parent
564e87f028
commit
a023987aae
@ -1,4 +1,4 @@
|
||||
# +-------------+---------+-----------------------+
|
||||
# +-----------------------------------------------+
|
||||
# | Created 2022-04-23 |
|
||||
# +-----------------------------------------------+
|
||||
|
||||
@ -27,7 +27,7 @@ IncludeBlocks: Regroup
|
||||
|
||||
# Allow short blocks on single line
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
@ -47,22 +47,22 @@ BitFieldColonSpacing: After
|
||||
BreakBeforeBraces: Custom
|
||||
# Disable that
|
||||
BraceWrapping:
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
AfterControlStatement: false
|
||||
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
|
||||
IndentBraces: false
|
||||
IndentBraces: false
|
||||
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyFunction: false
|
||||
|
||||
# Don't break before ?:, it looks ugly
|
||||
BreakBeforeTernaryOperators: false
|
||||
|
@ -37,7 +37,6 @@ inv_sbox = [
|
||||
for key in keys:
|
||||
|
||||
key = bytes.fromhex(key)
|
||||
|
||||
cipher = Cipher(algorithms.AES128(key), modes.ECB());
|
||||
enc = cipher.encryptor()
|
||||
|
||||
|
19
common/io.c
19
common/io.c
@ -5,7 +5,24 @@
|
||||
#include <string.h>
|
||||
#include "mem.h"
|
||||
// 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) {
|
||||
if (i > '9')
|
||||
|
19
common/lib.c
19
common/lib.c
@ -4,14 +4,23 @@
|
||||
#include <stdlib.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);
|
||||
//int memcmp(const void *__s1, const void *__s2, size_t __n);
|
||||
|
||||
void sha1 (void *buf,size_t size, char * out_buf) {}
|
||||
void sha256 (void *buf,size_t size, char * out_buf) {}
|
||||
void sha512 (void *buf,size_t size, char * out_buf) {}
|
||||
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 */}
|
||||
|
||||
#endif // __uC_LIB_C__
|
||||
|
Loading…
Reference in New Issue
Block a user