* @return NULL on failure, pointer to allocated memory otherwise.
* @see yaca_zalloc(), yaca_realloc(), yaca_free()
*/
-// TODO: this should be a macro to CRYPTO_*
void *yaca_malloc(size_t size);
/**
* @return NULL on failure, pointer to allocated and zeroed memory otherwise.
* @see yaca_malloc(), yaca_realloc(), yaca_free()
*/
-// TODO: this should be a macro to CRYPTO_*
void *yaca_zalloc(size_t size);
/**
* @return NULL on failure, pointer to allocated memory otherwise.
* @see yaca_malloc(), yaca_zalloc(), yaca_free()
*/
-// TODO: this should be a macro to CRYPTO_*
void *yaca_realloc(void *addr, size_t size);
/**
* @see yaca_malloc(), yaca_zalloc(), yaca_realloc()
*
*/
-// TODO: this should be a macro to CRYPTO_*
void yaca_free(void *ptr);
/**
dump_hex(enc, 16, "Encrypted data (16 of %zu bytes): ",
enc_size);
- yaca_ctx_free(ctx); // TODO: perhaps it should not return value
+ yaca_ctx_free(ctx);
}
/// Decryption
encrypt_advanced();
- yaca_exit(); // TODO: what about handing of return value from exit??
+ yaca_exit();
return ret;
}
dump_hex(ciphertext, 16, "Encrypted data (16 of %zu bytes): ", ciphertext_len);
- yaca_ctx_free(ctx); // TODO: perhaps it should not return value
+ yaca_ctx_free(ctx);
}
/// Decryption
encrypt_decrypt_aes_gcm();
- yaca_exit(); // TODO: what about handing of return value from exit??
+ yaca_exit();
return ret;
}
if (ret != 0)
return ret;
- // TODO: use zalloc when available
- nc = yaca_malloc(sizeof(struct yaca_sign_ctx_s));
+ nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
if (nc == NULL) {
ret = YACA_ERROR_OUT_OF_MEMORY;
goto free_key;
if (ret != 0)
return ret;
- // TODO: use zalloc when available
- nc = yaca_malloc(sizeof(struct yaca_sign_ctx_s));
+ nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
if (nc == NULL) {
ret = YACA_ERROR_OUT_OF_MEMORY;
goto free_key;