|
@@ -9,16 +9,12 @@ u8 gkey[32] = {0x00};
|
|
|
|
|
|
|
|
|
uint8_t get_key(uint8_t* k, uint8_t len) {
|
|
|
-
|
|
|
simpleserial_put('o', 32, gkey);
|
|
|
return 0x00;
|
|
|
}
|
|
|
|
|
|
uint8_t set_key(uint8_t* key, uint8_t len) {
|
|
|
-
|
|
|
-
|
|
|
memcpy(gkey, key, 32);
|
|
|
- simpleserial_put('o', 32, gkey);
|
|
|
return 0x00;
|
|
|
}
|
|
|
|
|
@@ -27,19 +23,14 @@ uint8_t get_pt(uint8_t* pt, uint8_t len) {
|
|
|
* Start user-specific code here. */
|
|
|
trigger_high();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- volatile uint8_t ppp[] = {0x42, 0x41, 0x41, 0x41,0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 };
|
|
|
+
|
|
|
+ volatile uint8_t testing_output[] = {0x42, 0x41, 0x41, 0x41,0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 };
|
|
|
|
|
|
|
|
|
trigger_low();
|
|
|
|
|
|
********************************/
|
|
|
- simpleserial_put('r', 16, ppp);
|
|
|
+ simpleserial_put('r', 16, testing_output);
|
|
|
|
|
|
return 0x00;
|
|
|
}
|
|
@@ -49,12 +40,10 @@ uint8_t encrypt_block(uint8_t* pt, uint8_t len) {
|
|
|
|
|
|
trigger_high();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
u8 key[32] = {0x00};
|
|
|
memcpy(key, gkey, 32);
|
|
|
u8 ct[16] = {0x00};
|
|
|
- EncryptBlock(pt, key, ct);
|
|
|
+ EncryptBlock(pt, key, ct);
|
|
|
|
|
|
trigger_low();
|
|
|
|
|
@@ -76,16 +65,17 @@ int main(void) {
|
|
|
trigger_setup();
|
|
|
|
|
|
|
|
|
+
|
|
|
putch('h');
|
|
|
putch('e');
|
|
|
putch('l');
|
|
|
putch('l');
|
|
|
putch('o');
|
|
|
putch('\n');
|
|
|
+ */
|
|
|
|
|
|
simpleserial_init();
|
|
|
simpleserial_addcmd('p', 16, get_pt);
|
|
|
- simpleserial_addcmd('l', 0, get_pt);
|
|
|
simpleserial_addcmd('e', 16, encrypt_block);
|
|
|
simpleserial_addcmd('k', 16, get_key);
|
|
|
simpleserial_addcmd('s', 32, set_key);
|