From 955fb912ab9563a5246f9d3bfda9ccfab187949f Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 29 Mar 2016 13:04:52 +0200 Subject: adding next steps for hotp tests: writing, reading and authorization for writing hotp code --- include/device_proto.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/device_proto.h') 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; -- cgit v1.2.1