mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
ChaCha20 implementation for encryption
Add an implementation in 8051 assembler for the generation of a ChaCha20 keystream and an encryption function using the keystream in C. A test function using the example from RFC7539 is provided in chacha20_test. Keys, nonce, and block counter and the pointers to the input plaintext, its length and the output pointer are provided via a struct chacha20, which also holds the working state of the ChaCha20 algorithm
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "uip/uip_arp.h"
|
||||
#include "machine.h"
|
||||
#include "phy.h"
|
||||
#include "crypto/chacha.h"
|
||||
|
||||
extern __code const struct machine machine;
|
||||
extern __xdata uint32_t flash_size;
|
||||
@@ -2037,6 +2038,7 @@ void main(void)
|
||||
set_sys_led_state(SYS_LED_ON);
|
||||
|
||||
cmd_editor_init();
|
||||
|
||||
while (1) {
|
||||
cmd_edit();
|
||||
idle(); // Enter Idle mode until interrupt occurs
|
||||
|
||||
Reference in New Issue
Block a user