+ printf(" c[%d] = ", outlen);
+ hexdump(c, outlen);
+
+ TEST_ASSERT(outlen != sizeof(P) ||
+ memcmp(c, E[t], sizeof(P)));
+ ret |= test;
+
+ /* test with small chunks of block size */
+ printf("Chunked encryption test from GOST R 34.13-2015 [%s] \n", mode);
+ int blocks = sizeof(P) / GRASSHOPPER_BLOCK_SIZE;
+ int z;
+ EVP_CIPHER_CTX_init(&ctx);
+ T(EVP_CipherInit_ex(&ctx, type, NULL, K, iv[t], 1));
+ T(EVP_CIPHER_CTX_set_padding(&ctx, 0));
+ memset(c, 0, sizeof(c));
+ for (z = 0; z < blocks; z++) {
+ int offset = z * GRASSHOPPER_BLOCK_SIZE;
+ int sz = GRASSHOPPER_BLOCK_SIZE;
+
+ T(EVP_CipherUpdate(&ctx, c + offset, &outlen, P + offset, sz));
+ }
+ outlen = z * GRASSHOPPER_BLOCK_SIZE;
+ T(EVP_CipherFinal_ex(&ctx, c + outlen, &tmplen));
+ EVP_CIPHER_CTX_cleanup(&ctx);
+ printf(" c[%d] = ", outlen);