diff options
author | Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> | 2018-08-21 19:23:38 +0300 |
---|---|---|
committer | Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> | 2018-08-21 20:09:13 +0300 |
commit | 5a00a20d64ec8f167452c1478d28c43e1e8480d1 (patch) | |
tree | cf1e079b5a8c1344e983e81205dc35f6cdfeaadb | |
parent | ff7f2ea479f5e42841e87cb9ca5259d6658c1f82 (diff) | |
download | gost-engine-5a00a20d64ec8f167452c1478d28c43e1e8480d1.zip gost-engine-5a00a20d64ec8f167452c1478d28c43e1e8480d1.tar.gz gost-engine-5a00a20d64ec8f167452c1478d28c43e1e8480d1.tar.bz2 |
test_grasshopper: drop test_omac
grasshopper-omac is not implemented in this version of engine.
-rw-r--r-- | test_grasshopper.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/test_grasshopper.c b/test_grasshopper.c index fb6b967..19e18bf 100644 --- a/test_grasshopper.c +++ b/test_grasshopper.c @@ -248,39 +248,6 @@ static int test_stream(const EVP_CIPHER *type, const char *name, return ret; } -static int test_omac() -{ - EVP_MD_CTX *ctx = EVP_MD_CTX_new(); - unsigned char mac[] = { 0x33,0x6f,0x4d,0x29,0x60,0x59,0xfb,0xe3 }; - unsigned char md_value[EVP_MAX_MD_SIZE]; - unsigned int md_len; - int test; - - OPENSSL_assert(ctx); - printf("OMAC test from GOST R 34.13-2015\n"); - EVP_MD_CTX_init(ctx); - /* preload cbc cipher for omac set key */ - EVP_add_cipher(cipher_gost_grasshopper_cbc()); - T(EVP_DigestInit_ex(ctx, grasshopper_omac(), NULL)); - if (EVP_MD_CTX_size(ctx) != sizeof(mac)) { - /* strip const out of EVP_MD_CTX_md() to - * overwrite output size, as test vector is 8 bytes */ - printf("Resize result size from %d to %zu\n", EVP_MD_CTX_size(ctx), sizeof(mac)); - T(EVP_MD_meth_set_result_size((EVP_MD *)EVP_MD_CTX_md(ctx), sizeof(mac))); - } - T(EVP_MD_meth_get_ctrl(EVP_MD_CTX_md(ctx))(ctx, EVP_MD_CTRL_SET_KEY, sizeof(K), (void *)K)); - T(EVP_DigestUpdate(ctx, P, sizeof(P))); - T(EVP_DigestFinal_ex(ctx, md_value, &md_len)); - EVP_MD_CTX_free(ctx); - printf(" MAC[%u] = ", md_len); - hexdump(md_value, md_len); - - TEST_ASSERT(md_len != sizeof(mac) || - memcmp(mac, md_value, md_len)); - - return test; -} - int main(int argc, char **argv) { int ret = 0; @@ -296,8 +263,6 @@ int main(int argc, char **argv) t->iv, t->iv_size, t->acpkm); } - ret |= test_omac(); - if (ret) printf(cDRED "= Some tests FAILED!\n" cNORM); else |