aboutsummaryrefslogtreecommitdiff
path: root/include/device_proto.h
diff options
context:
space:
mode:
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;