| 104 | } |
| 105 | |
| 106 | bool tpt_equal(tpt_context *c, const void *a, const void *b, size_t n) { |
| 107 | const unsigned char *x = a, *y = b; |
| 108 | while (n) { |
| 109 | size_t chunk = n > TPT_CHUNK ? TPT_CHUNK : n; |
| 110 | if (!tpt_poll(c) || memcmp(x, y, chunk)) |
| 111 | return false; |
| 112 | x += chunk; |
| 113 | y += chunk; |
| 114 | n -= chunk; |
| 115 | } |
| 116 | return true; |
| 117 | } |
| 118 | |
| 119 | bool tpt_length(tpt_context *c, const char *s, size_t max, size_t *out) { |
| 120 | if (!s) |
no test coverage detected