Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: crypto/test/auth_driver.c

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/replay/ut_sim.c ('k') | crypto/test/cipher_driver.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/test/auth_driver.c
diff --git a/srtp/crypto/test/auth_driver.c b/crypto/test/auth_driver.c
similarity index 94%
rename from srtp/crypto/test/auth_driver.c
rename to crypto/test/auth_driver.c
index cd8a75dd09a0854ff2e09d7716196afa19f0fd28..47fa704818a1931e9628439529dbe961d8a1fc25 100644
--- a/srtp/crypto/test/auth_driver.c
+++ b/crypto/test/auth_driver.c
@@ -53,7 +53,7 @@
#define PRINT_DEBUG_DATA 0
-extern auth_type_t tmmhv2;
+extern srtp_auth_type_t tmmhv2;
const uint16_t msg0[9] = {
0x6015, 0xf141, 0x5ba1, 0x29a0, 0xf604, 0xd1c, 0x2d9, 0xaa8a, 0x7931
@@ -163,8 +163,7 @@ main (int argc, char *argv[]) {
#include <time.h>
-double
-auth_bits_per_second(auth_t *a, int msg_len_octets) {
+double auth_bits_per_second(auth_t *a, int msg_len_octets) {
int i;
clock_t timer;
uint8_t *result;
@@ -172,16 +171,16 @@ auth_bits_per_second(auth_t *a, int msg_len_octets) {
uint16_t *msg_string;
/* create random message */
- msg_string = (uint16_t *) crypto_alloc(msg_len_octets);
+ msg_string = (uint16_t *) srtp_crypto_alloc(msg_len_octets);
if (msg_string == NULL)
return 0.0; /* indicate failure */
for (i=0; i < msg_len; i++)
msg_string[i] = (uint16_t) random();
/* allocate temporary storage for authentication tag */
- result = crypto_alloc(auth_get_tag_length(a));
+ result = srtp_crypto_alloc(auth_get_tag_length(a));
if (result == NULL) {
- free(msg_string);
+ srtp_crypto_free(msg_string);
return 0.0; /* indicate failure */
}
@@ -191,8 +190,8 @@ auth_bits_per_second(auth_t *a, int msg_len_octets) {
}
timer = clock() - timer;
- free(msg_string);
- free(result);
+ srtp_crypto_free(msg_string);
+ srtp_crypto_free(result);
return (double) NUM_TRIALS * 8 * msg_len_octets * CLOCKS_PER_SEC / timer;
}
« no previous file with comments | « crypto/replay/ut_sim.c ('k') | crypto/test/cipher_driver.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698