aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-15 12:18:57 -0400
committerJack Lloyd <[email protected]>2018-08-15 12:23:50 -0400
commit2a8ef82de490dba1cf4dcd34c6c97022a5d18b1a (patch)
tree70e1fd657617b5bb57a6b5dc2819f859d02dd6ae /src/lib/misc
parent5ccc9e45f7d4a3a68416ed93de31105fc9ff9e08 (diff)
Expose HOTP to FFI
Diffstat (limited to 'src/lib/misc')
-rw-r--r--src/lib/misc/hotp/hotp.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/misc/hotp/hotp.cpp b/src/lib/misc/hotp/hotp.cpp
index e4dc6e5e3..c4c0c7770 100644
--- a/src/lib/misc/hotp/hotp.cpp
+++ b/src/lib/misc/hotp/hotp.cpp
@@ -39,9 +39,7 @@ HOTP::HOTP(const SymmetricKey& key, const std::string& hash_algo, size_t digits)
uint32_t HOTP::generate_hotp(uint64_t counter)
{
- uint8_t counter8[8] = { 0 };
- store_be(counter, counter8);
- m_mac->update(counter8, sizeof(counter8));
+ m_mac->update_be(counter);
const secure_vector<uint8_t> mac = m_mac->final();
const size_t offset = mac[mac.size()-1] & 0x0F;