Lines Matching refs:bin_len
15 size_t bin_len, bin_len2;
55 bin_len = (size_t) randombytes_uniform(sizeof buf1);
56 randombytes_buf(buf1, bin_len);
57 randombytes_buf(buf2, bin_len);
58 for (j = 0U; j < bin_len; j++) {
59 buf1_rev[bin_len - 1 - j] = buf1[j];
60 buf2_rev[bin_len - 1 - j] = buf2[j];
62 if (memcmp(buf1_rev, buf2_rev, bin_len) *
63 sodium_compare(buf1, buf2, bin_len) <
66 (unsigned int) bin_len);
68 memcpy(buf1, buf2, bin_len);
69 if (sodium_compare(buf1, buf2, bin_len)) {
71 (unsigned int) bin_len);
85 bin_len = randombytes_uniform(sizeof buf1);
86 randombytes_buf(buf1, bin_len);
87 memcpy(buf2, buf1, bin_len);
88 memset(buf_add, 0, bin_len);
91 sodium_increment(buf1, bin_len);
92 sodium_increment(buf_add, bin_len);
94 sodium_add(buf2, buf_add, bin_len);
95 if (sodium_compare(buf1, buf2, bin_len) != 0) {
98 bin_len = randombytes_uniform(sizeof buf1);
99 randombytes_buf(buf1, bin_len);
100 memcpy(buf2, buf1, bin_len);
101 memset(buf_add, 0xff, bin_len);
102 sodium_increment(buf2, bin_len);
104 sodium_add(buf2, buf_add, bin_len);
106 if (sodium_compare(buf1, buf2, bin_len) != 0) {
146 bin_len = randombytes_uniform(200U);
148 bin_padded_maxlen = bin_len + (blocksize - bin_len % blocksize);
152 assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
154 assert(sodium_pad(NULL, bin_padded, bin_len,
156 assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
158 assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
160 assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
170 assert(bin_len2 == bin_len);