aboutsummaryrefslogtreecommitdiff
path: root/zencore/crypto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/crypto.cpp')
-rw-r--r--zencore/crypto.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/zencore/crypto.cpp b/zencore/crypto.cpp
index 0ad368f3f..448fd36fa 100644
--- a/zencore/crypto.cpp
+++ b/zencore/crypto.cpp
@@ -64,10 +64,7 @@ namespace crypto {
if (Err != 1)
{
- if (Reason)
- {
- Reason = fmt::format("failed to initialize cipher, error code '{}'", Err);
- }
+ Reason = fmt::format("failed to initialize cipher, error code '{}'", Err);
return MemoryView();
}
@@ -83,10 +80,7 @@ namespace crypto {
if (Err != 1)
{
- if (Reason)
- {
- Reason = fmt::format("update crypto transform failed, error code '{}'", Err);
- }
+ Reason = fmt::format("update crypto transform failed, error code '{}'", Err);
return MemoryView();
}
@@ -100,10 +94,7 @@ namespace crypto {
if (Err != 1)
{
- if (Reason)
- {
- Reason = fmt::format("finalize crypto transform failed, error code '{}'", Err);
- }
+ Reason = fmt::format("finalize crypto transform failed, error code '{}'", Err);
return MemoryView();
}
@@ -117,20 +108,14 @@ namespace crypto {
{
if (Key.IsValid() == false)
{
- if (Reason)
- {
- Reason = "Invalid key"sv;
- }
+ Reason = "invalid key"sv;
return false;
}
if (IV.IsValid() == false)
{
- if (Reason)
- {
- Reason = "Invalid initialization vector"sv;
- }
+ Reason = "invalid initialization vector"sv;
return false;
}