| 90 | } |
| 91 | |
| 92 | bool memeqzero(const void *data, size_t length) |
| 93 | { |
| 94 | const unsigned char *p = data; |
| 95 | size_t len; |
| 96 | |
| 97 | /* Check first 16 bytes manually */ |
| 98 | for (len = 0; len < 16; len++) { |
| 99 | if (!length) |
| 100 | return true; |
| 101 | if (*p) |
| 102 | return false; |
| 103 | p++; |
| 104 | length--; |
| 105 | } |
| 106 | |
| 107 | /* Now we know that's zero, memcmp with self. */ |
| 108 | return memcmp(data, p, length) == 0; |
| 109 | } |
| 110 | |
| 111 | void memtaint(void *data, size_t len) |
| 112 | { |
no outgoing calls