Lines Matching refs:buf
70 unsigned char buf[2048]; in main() local
143 memset(buf, 0, sizeof(buf)); in main()
145 if ((ret = mbedtls_net_recv(&server_fd, buf, 2)) != 2) { in main()
150 n = buflen = (buf[0] << 8) | buf[1]; in main()
151 if (buflen < 1 || buflen > sizeof(buf)) { in main()
159 memset(buf, 0, sizeof(buf)); in main()
161 if ((ret = mbedtls_net_recv(&server_fd, buf, n)) != (int) n) { in main()
166 p = buf, end = buf + buflen; in main()
193 if ((ret = mbedtls_sha1(buf, (int) (p - 2 - buf), hash)) != 0) { in main()
211 if ((ret = mbedtls_dhm_make_public(&dhm, (int) n, buf, n, in main()
217 if ((ret = mbedtls_net_send(&server_fd, buf, n)) != (int) n) { in main()
228 if ((ret = mbedtls_dhm_calc_secret(&dhm, buf, sizeof(buf), &n, in main()
235 mbedtls_printf("%02x", buf[n]); in main()
249 ret = mbedtls_aes_setkey_dec(&aes, buf, 256); in main()
254 memset(buf, 0, sizeof(buf)); in main()
256 if ((ret = mbedtls_net_recv(&server_fd, buf, 16)) != 16) { in main()
261 ret = mbedtls_aes_crypt_ecb(&aes, MBEDTLS_AES_DECRYPT, buf, buf); in main()
265 buf[16] = '\0'; in main()
266 mbedtls_printf("\n . Plaintext is \"%s\"\n\n", (char *) buf); in main()