Turns out the standard guarantees that NULL is defined in `stddef.h`.
Contrary to what I used to believe, using it doesn't induce any further
dependency. `0` is also guaranteed by the standard to work, but it's
less explicit and in some cases more error prone.
size_t nb_blocks = text_size >> 6;
FOR (i, 0, nb_blocks) {
chacha20_rounds(pool, input);
- if (plain_text != 0) {
+ if (plain_text != NULL) {
FOR (j, 0, 16) {
u32 p = pool[j] + input[j];
store32_le(cipher_text, p ^ load32_le(plain_text));
// Last (incomplete) block
if (text_size > 0) {
- if (plain_text == 0) {
+ if (plain_text == NULL) {
plain_text = zero;
}
chacha20_rounds(pool, input);