comparison dbutil.c @ 835:4095b6d7c9fc ecc

Merge in changes from the past couple of releases
author Matt Johnston <matt@ucc.asn.au>
date Fri, 18 Oct 2013 21:38:01 +0800
parents 7dcb46da72d9 a625f9e135a4
children 30ab30e46452
comparison
equal deleted inserted replaced
807:75509065db53 835:4095b6d7c9fc
890 return DROPBEAR_FAILURE; 890 return DROPBEAR_FAILURE;
891 } else { 891 } else {
892 return DROPBEAR_SUCCESS; 892 return DROPBEAR_SUCCESS;
893 } 893 }
894 } 894 }
895
896 int constant_time_memcmp(const void* a, const void *b, size_t n)
897 {
898 const char *xa = a, *xb = b;
899 uint8_t c = 0;
900 size_t i;
901 for (i = 0; i < n; i++)
902 {
903 c |= (xa[i] ^ xb[i]);
904 }
905 return c;
906 }
907