mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-11-21 21:25:50 +00:00
Reorder for consistency
This commit is contained in:
parent
ca46c7c591
commit
7c9b8f108a
1 changed files with 23 additions and 23 deletions
46
t/t_md4.c
46
t/t_md4.c
|
@ -169,6 +169,29 @@ t_md4_vector(char **desc CRYB_UNUSED, void *arg)
|
|||
return (1);
|
||||
}
|
||||
|
||||
|
||||
#if !defined(WITH_OPENSSL) && !defined(WITH_RSAREF)
|
||||
/*
|
||||
* Various corner cases and error conditions
|
||||
*/
|
||||
static int
|
||||
t_md4_short_updates(char **desc CRYB_UNUSED, void *arg)
|
||||
{
|
||||
struct t_vector *vector = (struct t_vector *)arg;
|
||||
uint8_t digest[MD4_DIGEST_LEN];
|
||||
md4_ctx ctx;
|
||||
int i, len;
|
||||
|
||||
md4_init(&ctx);
|
||||
len = strlen(vector->msg);
|
||||
for (i = 0; i + 5 < len; i += 5)
|
||||
md4_update(&ctx, vector->msg + i, 5);
|
||||
md4_update(&ctx, vector->msg + i, len - i);
|
||||
md4_final(&ctx, digest);
|
||||
return (memcmp(digest, vector->digest, MD4_DIGEST_LEN) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BENCHMARKS
|
||||
/*
|
||||
* Performance test: measure the time spent computing the MD4 sum of a
|
||||
|
@ -202,29 +225,6 @@ t_md4_perf(char **desc, void *arg)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(WITH_OPENSSL) && !defined(WITH_RSAREF)
|
||||
/*
|
||||
* Various corner cases and error conditions
|
||||
*/
|
||||
static int
|
||||
t_md4_short_updates(char **desc CRYB_UNUSED, void *arg)
|
||||
{
|
||||
struct t_vector *vector = (struct t_vector *)arg;
|
||||
uint8_t digest[MD4_DIGEST_LEN];
|
||||
md4_ctx ctx;
|
||||
int i, len;
|
||||
|
||||
md4_init(&ctx);
|
||||
len = strlen(vector->msg);
|
||||
for (i = 0; i + 5 < len; i += 5)
|
||||
md4_update(&ctx, vector->msg + i, 5);
|
||||
md4_update(&ctx, vector->msg + i, len - i);
|
||||
md4_final(&ctx, digest);
|
||||
return (memcmp(digest, vector->digest, MD4_DIGEST_LEN) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Boilerplate
|
||||
|
|
Loading…
Reference in a new issue