fflush(stdout);
siglen = EVP_PKEY_size(pkey);
sigbuf = malloc(siglen * cycles);
+ if (!sigbuf) {
+ fprintf(stderr, "No tests were run, malloc failure.\n");
+ exit(1);
+ }
for (pass = 0; pass < 2; pass++) {
struct timespec ts;
EVP_PKEY *sec_key = EVP_PKEY_CTX_get0_peerkey(pctx);
if (data->shared_ukm) {
memcpy(ukm, data->shared_ukm, 8);
- } else if (out) {
-
+ } else {
if (RAND_bytes(ukm, 8) <= 0) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT, GOST_R_RNG_ERROR);
return 0;
/*
* Function expects that shared_key is a preallocated buffer
- * with length defined as expkeylen - mac_len defined by mac_nid
+ * with length defined as expkeylen + mac_len defined by mac_nid
* */
int gost_kimp15(const unsigned char *expkey, const size_t expkeylen,
int cipher_nid, const unsigned char *cipher_key,
EVP_Cipher(enc, data0_processed+sizeof(data0), mac0, 16);
hexdump(stderr, "ENC0 result", data0_processed, 31);
- if (memcmp(enc0_etl, data0_processed, 16) != 0) {
+ if (memcmp(enc0_etl, data0_processed, sizeof(data0_processed)) != 0) {
fprintf(stderr, "ENC0 mismatch");
exit(1);
}