Lines Matching defs:buf
58 unsigned char buf[2048];
177 memset(buf, 0, sizeof(buf));
180 mbedtls_dhm_make_params(&dhm, (int) mbedtls_dhm_get_len(&dhm), buf, &n,
196 if ((ret = mbedtls_sha256(buf, n, hash, 0)) != 0) {
202 buf[n] = (unsigned char) (rsa_key_len >> 8);
203 buf[n + 1] = (unsigned char) (rsa_key_len);
207 hash, buf + n + 2)) != 0) {
217 (ret = mbedtls_net_send(&client_fd, buf, buflen)) != (int) buflen) {
228 memset(buf, 0, sizeof(buf));
231 if ((ret = mbedtls_net_recv(&client_fd, buf, n)) != (int) n) {
236 if ((ret = mbedtls_dhm_read_public(&dhm, buf, n)) != 0) {
247 if ((ret = mbedtls_dhm_calc_secret(&dhm, buf, sizeof(buf), &n,
254 mbedtls_printf("%02x", buf[n]);
268 ret = mbedtls_aes_setkey_enc(&aes, buf, 256);
272 memcpy(buf, PLAINTEXT, 16);
273 ret = mbedtls_aes_crypt_ecb(&aes, MBEDTLS_AES_ENCRYPT, buf, buf);
278 if ((ret = mbedtls_net_send(&client_fd, buf, 16)) != 16) {