diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index b5b257e..eae209e 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -292,7 +292,15 @@
   // create new request instance
   uint8_t requestIdData[32];
   Block certNameTlv = clientCert->getName().wireEncode();
-  hmac_sha256(certNameTlv.wire(), certNameTlv.size(), m_requestIdGenKey, 32, requestIdData);
+  try {
+    hmac_sha256(certNameTlv.wire(), certNameTlv.size(), m_requestIdGenKey, 32, requestIdData);
+  }
+  catch (const std::runtime_error& e) {
+    NDN_LOG_ERROR("Error computing the request ID: " << std::string(e.what()));
+    m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
+                                       "Error computing the request ID."));
+    return;
+  }
   CaState requestState(m_config.m_caItem.m_caPrefix, toHex(requestIdData, 32),
                        requestType, Status::BEFORE_CHALLENGE, *clientCert,
                        makeBinaryBlock(ndn::tlv::ContentType_Key, aesKey, sizeof(aesKey)));
@@ -302,7 +310,7 @@
   catch (const std::runtime_error& e) {
     NDN_LOG_ERROR("Duplicate Request ID: The same request has been seen before.");
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
-                                       "Duplicate Request ID: The same request has been seen before.."));
+                                       "Duplicate Request ID: The same request has been seen before."));
     return;
   }
   Data result;
diff --git a/src/detail/crypto-helper.cpp b/src/detail/crypto-helper.cpp
index a7f561d..0c1dfbd 100644
--- a/src/detail/crypto-helper.cpp
+++ b/src/detail/crypto-helper.cpp
@@ -24,6 +24,7 @@
 #include <openssl/pem.h>
 #include <openssl/ec.h>
 #include <openssl/evp.h>
+#include <openssl/kdf.h>
 #include <ndn-cxx/encoding/buffer-stream.hpp>
 #include <ndn-cxx/security/transform/base64-decode.hpp>
 #include <ndn-cxx/security/transform/base64-encode.hpp>
@@ -37,25 +38,13 @@
 namespace ndn {
 namespace ndncert {
 
-const size_t HASH_SIZE = 32;
-
-NDN_LOG_INIT(ndncert.cryptosupport);
-
-void
-handleErrors(const std::string& errorInfo)
-{
-  NDN_LOG_DEBUG("Error in CRYPTO SUPPORT " << errorInfo);
-  NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: " + errorInfo));
-}
-
 struct ECDHState::ECDH_CTX
 {
-  int EC_NID;
-  EVP_PKEY_CTX* ctx_params;
-  EVP_PKEY_CTX* ctx_keygen;
-  EVP_PKEY* privkey;
-  EVP_PKEY* peerkey;
-  EVP_PKEY* params;
+  EVP_PKEY_CTX* ctx_params = nullptr;
+  EVP_PKEY_CTX* ctx_keygen = nullptr;
+  EVP_PKEY* privkey = nullptr;
+  EVP_PKEY* peerkey = nullptr;
+  EVP_PKEY* params = nullptr;
 };
 
 ECDHState::ECDHState()
@@ -64,50 +53,43 @@
 {
   OpenSSL_add_all_algorithms();
   context = std::make_unique<ECDH_CTX>();
-  context->EC_NID = NID_X9_62_prime256v1;
+  auto EC_NID = NID_X9_62_prime256v1;
 
   // Create the context for parameter generation
   if (nullptr == (context->ctx_params = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr))) {
-    handleErrors("Could not create context contexts.");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not create context contexts."));
   }
 
   // Initialise the parameter generation
   if (EVP_PKEY_paramgen_init(context->ctx_params) != 1) {
-    handleErrors("Could not initialize parameter generation.");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not initialize parameter generation."));
   }
 
   // We're going to use the ANSI X9.62 Prime 256v1 curve
-  if (1 != EVP_PKEY_CTX_set_ec_paramgen_curve_nid(context->ctx_params, context->EC_NID)) {
-    handleErrors("Likely unknown elliptical curve ID specified.");
-    return;
+  if (1 != EVP_PKEY_CTX_set_ec_paramgen_curve_nid(context->ctx_params, EC_NID)) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Likely unknown elliptical curve ID specified."));
   }
 
   // Create the parameter object params
   if (!EVP_PKEY_paramgen(context->ctx_params, &context->params)) {
     // the generated key is written to context->params
-    handleErrors("Could not create parameter object parameters.");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not create parameter object parameters."));
   }
 
   // Create the context for the key generation
   if (nullptr == (context->ctx_keygen = EVP_PKEY_CTX_new(context->params, nullptr))) {
     //The EVP_PKEY_CTX_new() function allocates public key algorithm context using
     //the algorithm specified in pkey and ENGINE e (in this case nullptr).
-    handleErrors("Could not create the context for the key generation");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not create the context for the key generation"));
   }
 
   // initializes a public key algorithm context
   if (1 != EVP_PKEY_keygen_init(context->ctx_keygen)) {
-    handleErrors("Could not init context for key generation.");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not init context for key generation."));
   }
   if (1 != EVP_PKEY_keygen(context->ctx_keygen, &context->privkey)) {
     //performs a key generation operation, the generated key is written to context->privkey.
-    handleErrors("Could not generate DHE keys in final step");
-    return;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not generate DHE keys in final step"));
   }
 }
 
@@ -139,8 +121,7 @@
   auto privECKey = EVP_PKEY_get1_EC_KEY(context->privkey);
 
   if (privECKey == nullptr) {
-    handleErrors("Could not get referenced key when calling EVP_PKEY_get1_EC_KEY().");
-    return nullptr;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not get key when calling EVP_PKEY_get1_EC_KEY()."));
   }
 
   auto ecPoint = EC_KEY_get0_public_key(privECKey);
@@ -149,10 +130,8 @@
                                       m_publicKey, 256, nullptr);
   EC_KEY_free(privECKey);
   if (m_publicKeyLen == 0) {
-    handleErrors("Could not convert EC_POINTS to octet string when calling EC_POINT_point2oct.");
-    return nullptr;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not convert EC_POINTS to octet string when calling EC_POINT_point2oct."));
   }
-
   return m_publicKey;
 }
 
@@ -175,8 +154,7 @@
   auto privECKey = EVP_PKEY_get1_EC_KEY(context->privkey);
 
   if (privECKey == nullptr) {
-    handleErrors("Could not get referenced key when calling EVP_PKEY_get1_EC_KEY()");
-    return nullptr;
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Could not get key when calling EVP_PKEY_get1_EC_KEY()"));
   }
 
   auto group = EC_KEY_get0_group(privECKey);
@@ -185,14 +163,14 @@
   if (result == 0) {
     EC_POINT_free(peerPoint);
     EC_KEY_free(privECKey);
-    handleErrors("Cannot convert peer's key into a EC point when calling EC_POINT_oct2point()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot convert peer's key into a EC point when calling EC_POINT_oct2point()"));
   }
 
   result = ECDH_compute_key(m_sharedSecret, 256, peerPoint, privECKey, nullptr);
   if (result == -1) {
     EC_POINT_free(peerPoint);
     EC_KEY_free(privECKey);
-    handleErrors("Cannot generate ECDH secret when calling ECDH_compute_key()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot generate ECDH secret when calling ECDH_compute_key()"));
   }
   m_sharedSecretLen = static_cast<size_t>(result);
   EC_POINT_free(peerPoint);
@@ -212,15 +190,16 @@
   return this->deriveSecret(result->data(), result->size());
 }
 
-int
+void
 hmac_sha256(const uint8_t* data, const unsigned data_length,
             const uint8_t* key, const unsigned key_length,
             uint8_t* result)
 {
-  HMAC(EVP_sha256(), key, key_length,
-       (unsigned char*)data, data_length,
-       (unsigned char*)result, nullptr);
-  return 0;
+  auto ret = HMAC(EVP_sha256(), key, key_length, (unsigned char*)data, data_length,
+                  (unsigned char*)result, nullptr);
+  if (ret == nullptr) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Error computing HMAC when calling HMAC()"));
+  }
 }
 
 int
@@ -228,50 +207,27 @@
      int salt_len, uint8_t* output, int output_len,
      const uint8_t* info, int info_len)
 {
-  namespace t = ndn::security::transform;
-
-  // hkdf generate prk
-  uint8_t prk[HASH_SIZE];
-  if (salt_len == 0) {
-    uint8_t realSalt[HASH_SIZE] = {0};
-    hmac_sha256(secret, secret_len, realSalt, HASH_SIZE, prk);
+  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, nullptr);
+  if (EVP_PKEY_derive_init(pctx) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot init ctx when calling EVP_PKEY_derive_init()."));
   }
-  else {
-    hmac_sha256(secret, secret_len, salt, salt_len, prk);
+  if (EVP_PKEY_CTX_set_hkdf_md(pctx, EVP_sha256()) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot set md when calling EVP_PKEY_CTX_set_hkdf_md()."));
   }
-
-  // hkdf expand
-  uint8_t prev[HASH_SIZE] = {0};
-  int done_len = 0, dig_len = HASH_SIZE, n = output_len / dig_len;
-  if (output_len % dig_len)
-    n++;
-  if (n > 255 || output == nullptr)
-    return 0;
-
-  for (int i = 1; i <= n; i++) {
-    size_t copy_len;
-    const uint8_t ctr = i;
-
-    t::StepSource source;
-    t::PrivateKey privKey;
-    privKey.loadRaw(KeyType::HMAC, prk, dig_len);
-    OBufferStream os;
-    source >> t::signerFilter(DigestAlgorithm::SHA256, privKey) >> t::streamSink(os);
-
-    if (i > 1) {
-      source.write(prev, dig_len);
-    }
-    source.write(info, info_len);
-    source.write(&ctr, 1);
-    source.end();
-
-    auto result = os.buf();
-    memcpy(prev, result->data(), dig_len);
-    copy_len = (done_len + dig_len > output_len) ? output_len - done_len : dig_len;
-    memcpy(output + done_len, prev, copy_len);
-    done_len += copy_len;
+  if (EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, salt_len) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot set salt when calling EVP_PKEY_CTX_set1_hkdf_salt()."));
   }
-  return done_len;
+  if (EVP_PKEY_CTX_set1_hkdf_key(pctx, secret, secret_len) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot set secret when calling EVP_PKEY_CTX_set1_hkdf_key()."));
+  }
+  if (EVP_PKEY_CTX_add1_hkdf_info(pctx, info, info_len) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot set info when calling EVP_PKEY_CTX_add1_hkdf_info()."));
+  }
+  size_t outLen = output_len;
+  if (EVP_PKEY_derive(pctx, output, &outLen) <= 0) {
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: HKDF: Cannot derive result when calling EVP_PKEY_derive()."));
+  }
+  return (int)outLen;
 }
 
 int
@@ -284,46 +240,46 @@
 
   // Create and initialise the context
   if (!(ctx = EVP_CIPHER_CTX_new())) {
-    handleErrors("Cannot create and initialise the context when calling EVP_CIPHER_CTX_new()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot create and initialise the context when calling EVP_CIPHER_CTX_new()"));
   }
 
   // Initialise the encryption operation.
   if (1 != EVP_EncryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
-    handleErrors("Cannot initialise the encryption operation when calling EVP_EncryptInit_ex()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot initialise the encryption operation when calling EVP_EncryptInit_ex()"));
   }
 
   // Set IV length if default 12 bytes (96 bits) is not appropriate
   if (1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 12, nullptr)) {
-    handleErrors("Cannot set IV length when calling EVP_CIPHER_CTX_ctrl()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot set IV length when calling EVP_CIPHER_CTX_ctrl()"));
   }
 
   // Initialise key and IV
   if (1 != EVP_EncryptInit_ex(ctx, nullptr, nullptr, key, iv)) {
-    handleErrors("Cannot initialize key and IV when calling EVP_EncryptInit_ex()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot initialize key and IV when calling EVP_EncryptInit_ex()"));
   }
 
   // Provide any AAD data. This can be called zero or more times as required
   if (1 != EVP_EncryptUpdate(ctx, nullptr, &len, associated, associated_len)) {
-    handleErrors("Cannot set associated authentication data when calling EVP_EncryptUpdate()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot set associated authentication data when calling EVP_EncryptUpdate()"));
   }
 
   // Provide the message to be encrypted, and obtain the encrypted output.
   // EVP_EncryptUpdate can be called multiple times if necessary
   if (1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len)) {
-    handleErrors("Cannot encrypt when calling EVP_EncryptUpdate()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot encrypt when calling EVP_EncryptUpdate()"));
   }
   ciphertext_len = len;
 
   // Finalise the encryption. Normally ciphertext bytes may be written at
   // this stage, but this does not occur in GCM mode
   if (1 != EVP_EncryptFinal_ex(ctx, ciphertext + len, &len)) {
-    handleErrors("Cannot finalise the encryption when calling EVP_EncryptFinal_ex()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot finalise the encryption when calling EVP_EncryptFinal_ex()"));
   }
   ciphertext_len += len;
 
   // Get the tag
   if (1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, tag)) {
-    handleErrors("Cannot get tag when calling EVP_CIPHER_CTX_ctrl()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot get tag when calling EVP_CIPHER_CTX_ctrl()"));
   }
 
   // Clean up
@@ -342,39 +298,39 @@
 
   // Create and initialise the context
   if (!(ctx = EVP_CIPHER_CTX_new())) {
-    handleErrors("Cannot create and initialise the context when calling EVP_CIPHER_CTX_new()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot create and initialise the context when calling EVP_CIPHER_CTX_new()"));
   }
 
   // Initialise the decryption operation.
   if (!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
-    handleErrors("Cannot initialise the decryption operation when calling EVP_DecryptInit_ex()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot initialise the decryption operation when calling EVP_DecryptInit_ex()"));
   }
 
   // Set IV length. Not necessary if this is 12 bytes (96 bits)
   if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 12, nullptr)) {
-    handleErrors("Cannot set IV length when calling EVP_CIPHER_CTX_ctrl");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot set IV length when calling EVP_CIPHER_CTX_ctrl"));
   }
 
   // Initialise key and IV
   if (!EVP_DecryptInit_ex(ctx, nullptr, nullptr, key, iv)) {
-    handleErrors("Cannot initialise key and IV when calling EVP_DecryptInit_ex()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot initialise key and IV when calling EVP_DecryptInit_ex()"));
   }
 
   // Provide any AAD data. This can be called zero or more times as required
   if (!EVP_DecryptUpdate(ctx, nullptr, &len, associated, associated_len)) {
-    handleErrors("Cannot set associated authentication data when calling EVP_EncryptUpdate()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot set associated authentication data when calling EVP_EncryptUpdate()"));
   }
 
   // Provide the message to be decrypted, and obtain the plaintext output.
   // EVP_DecryptUpdate can be called multiple times if necessary
   if (!EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len)) {
-    handleErrors("Cannot decrypt when calling EVP_DecryptUpdate()");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot decrypt when calling EVP_DecryptUpdate()"));
   }
   plaintext_len = len;
 
   // Set expected tag value. Works in OpenSSL 1.0.1d and later
   if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)tag)) {
-    handleErrors("Cannot set tag value when calling EVP_CIPHER_CTX_ctrl");
+    NDN_THROW(std::runtime_error("Error in CRYPTO SUPPORT: Cannot set tag value when calling EVP_CIPHER_CTX_ctrl"));
   }
 
   // Finalise the decryption. A positive return value indicates success,
diff --git a/src/detail/crypto-helper.hpp b/src/detail/crypto-helper.hpp
index 50aa7bb..38110c5 100644
--- a/src/detail/crypto-helper.hpp
+++ b/src/detail/crypto-helper.hpp
@@ -84,9 +84,9 @@
  * @p key, intput, the key for the function
  * @p key_len, intput, the length of the key
  * @p result, output, result of the HMAC. Enough memory (32 Bytes) must be allocated beforehands
- * @return 0 if successful, -1 if failed
+ * @throw runtime_error when an error occurred in the underlying HMAC.
  */
-int
+void
 hmac_sha256(const uint8_t* data, const unsigned data_length,
             const uint8_t* key, const unsigned key_length,
             uint8_t* result);
