aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/fpe_fe1
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-07-13 11:59:53 -0400
committerJack Lloyd <[email protected]>2018-07-13 11:59:53 -0400
commitd145ad41b3ffca7756db843e3df6e167a2959049 (patch)
tree309df9cf49305507dc4bf89ab1caeaf06078b60a /src/lib/misc/fpe_fe1
parent1cf1682035fd56e7f997e6570bd9755b6eb42eef (diff)
Add FPE1 to C API
GH #1612
Diffstat (limited to 'src/lib/misc/fpe_fe1')
-rw-r--r--src/lib/misc/fpe_fe1/fpe_fe1.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/misc/fpe_fe1/fpe_fe1.cpp b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
index 8cd79401c..680967ea9 100644
--- a/src/lib/misc/fpe_fe1/fpe_fe1.cpp
+++ b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
@@ -134,7 +134,8 @@ secure_vector<uint8_t> FPE_FE1::compute_tweak_mac(const uint8_t tweak[], size_t
m_mac->update(m_n_bytes.data(), m_n_bytes.size());
m_mac->update_be(static_cast<uint32_t>(tweak_len));
- m_mac->update(tweak, tweak_len);
+ if(tweak_len > 0)
+ m_mac->update(tweak, tweak_len);
return m_mac->final();
}