X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-prf_tls12-test.c;h=b97d8ea804dca6dc5b5681fd4d9de4a37a0b7613;hb=1cc5630207195b3bc9d967596a9a207c1c0f6464;hp=037b379c4265bfc6bd40b633724c15e982d57119;hpb=b9d6e1eb867eaa431c4c555a7409342805fa2706;p=arm-crypto-lib.git diff --git a/test_src/main-prf_tls12-test.c b/test_src/main-prf_tls12-test.c index 037b379..b97d8ea 100644 --- a/test_src/main-prf_tls12-test.c +++ b/test_src/main-prf_tls12-test.c @@ -76,17 +76,14 @@ const char test_label[] = "test label"; void test_prf(const hfdesc_t* hash){ prf_tls12_ctx_t ctx; + uint8_t buffer[100]; prf_tls12_init_w_label(&ctx, hash, test_secret, 16*8, test_label, strlen(test_label), test_seed, 16*8); - uint8_t buffer[ctx.blocklength_b/8]; - uint16_t i=0; cli_putstr("\r\n== Testing PRF-TLSv1.2 with "); cli_putstr(hash->name); cli_putstr(" ==\r\n"); - do{ - prf_tls12_next(buffer, &ctx); - cli_hexdump_block(buffer, ctx.blocklength_b/8, 4, 8); - i += ctx.blocklength_b/8; - }while(i<100); + prf_tls12_fill(buffer, 100, &ctx); + cli_hexdump_block(buffer, 100, 4, 8); + prf_tls12_free(&ctx); } void test_sha256(void){