mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e39d81992 | ||
|
|
7621045de1 |
+2
-7
@@ -9,13 +9,9 @@ void chacha_count(void);
|
|||||||
|
|
||||||
|
|
||||||
__xdata struct chacha20_t __at(0xbf00) chacha20;
|
__xdata struct chacha20_t __at(0xbf00) chacha20;
|
||||||
|
|
||||||
#ifdef CHACHA20_TEST
|
|
||||||
__xdata uint8_t plaintext[256];
|
__xdata uint8_t plaintext[256];
|
||||||
__xdata uint8_t cyphertext[256];
|
__xdata uint8_t cyphertext[256];
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
void chacha20_print_block(void)
|
void chacha20_print_block(void)
|
||||||
{
|
{
|
||||||
for (uint8_t i=0; i < 64; i++) {
|
for (uint8_t i=0; i < 64; i++) {
|
||||||
@@ -24,7 +20,7 @@ void chacha20_print_block(void)
|
|||||||
write_char(' ');
|
write_char(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void chacha20_encrypt(void)
|
void chacha20_encrypt(void)
|
||||||
{
|
{
|
||||||
@@ -51,7 +47,7 @@ void chacha20_encrypt(void)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHACHA20_TEST
|
|
||||||
// Test the example of RFC 7539 Section 2.4.2
|
// Test the example of RFC 7539 Section 2.4.2
|
||||||
void chacha20_test(void)
|
void chacha20_test(void)
|
||||||
{
|
{
|
||||||
@@ -100,4 +96,3 @@ void chacha20_test(void)
|
|||||||
print_byte(cyphertext[i]); write_char(' ');
|
print_byte(cyphertext[i]); write_char(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
Reference in new issue
Block a user