summaryrefslogtreecommitdiff
path: root/include/device_proto.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan.zalega@gmail.com>2016-03-29 13:04:52 +0200
committerSzczepan Zalega <szczepan.zalega@gmail.com>2016-03-29 13:04:52 +0200
commit955fb912ab9563a5246f9d3bfda9ccfab187949f (patch)
treed0baaea9d86ca6d17e3bd7351ab3083a6697ee8f /include/device_proto.h
parent75bbfc7d9e3d0f26a507c494b1e94fe71fa26ad0 (diff)
downloadlibnitrokey-955fb912ab9563a5246f9d3bfda9ccfab187949f.tar.gz
libnitrokey-955fb912ab9563a5246f9d3bfda9ccfab187949f.tar.bz2
adding next steps for hotp tests: writing, reading and authorization for writing hotp code
Diffstat (limited to 'include/device_proto.h')
-rw-r--r--include/device_proto.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/device_proto.h b/include/device_proto.h
index f2ed84d..e05a303 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -151,6 +151,15 @@ class Transaction : semantics::non_constructible {
static_assert(sizeof(ResponsePacket) == HID_REPORT_SIZE,
"ResponsePacket type is not the right size");
+ static uint32_t getCRC(
+ const command_payload &payload) {
+ OutgoingPacket outp;
+ outp.initialize();
+ outp.payload = payload;
+ outp.update_CRC();
+ return outp.crc;
+ }
+
static response_payload run(device::Device &dev,
const command_payload &payload) {
using namespace ::nitrokey::device;