diff options
author | Szczepan Zalega <szczepan.zalega@gmail.com> | 2016-03-29 13:04:52 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan.zalega@gmail.com> | 2016-03-29 13:04:52 +0200 |
commit | 955fb912ab9563a5246f9d3bfda9ccfab187949f (patch) | |
tree | d0baaea9d86ca6d17e3bd7351ab3083a6697ee8f /include/device_proto.h | |
parent | 75bbfc7d9e3d0f26a507c494b1e94fe71fa26ad0 (diff) | |
download | libnitrokey-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.h | 9 |
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; |