From 2e9c5bde8e3b5c11408ea222ab7617df0e04eeec Mon Sep 17 00:00:00 2001 From: julian <julian@cypherstack.com> Date: Thu, 27 Jul 2023 12:11:30 -0600 Subject: [PATCH] clean up compile time errors only --- lib/services/cashfusion/covert.dart | 7 ++++--- lib/services/cashfusion/encrypt.dart | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/services/cashfusion/covert.dart b/lib/services/cashfusion/covert.dart index d034f9e99..62e5ed5a1 100644 --- a/lib/services/cashfusion/covert.dart +++ b/lib/services/cashfusion/covert.dart @@ -82,7 +82,7 @@ class CovertConnection { int? slotNum; DateTime? tPing; int? connNumber; - Completer wakeup = Completer(); + Completer<bool> wakeup = Completer(); double? delay; Future<bool> waitWakeupOrTime(DateTime? t) async { @@ -258,7 +258,8 @@ class CovertSubmitter extends PrintError { } } - void scheduleSubmit(int slotNum, DateTime tStart, dynamic subMsg) { + void scheduleSubmit( + int slotNum, DateTime tStart, pb.GeneratedMessage subMsg) { var slot = slots[slotNum]; assert(slot.done, "tried to set new work when prior work not done"); @@ -290,7 +291,7 @@ class CovertSubmitter extends PrintError { // Then, notify the slots that there is a message to submit. for (var i = 0; i < slots.length; i++) { var slot = slots[i]; - var subMsg = slotMessages[i]; + var subMsg = slotMessages[i] as pb.GeneratedMessage; var covConn = slot.covConn; if (covConn != null) { diff --git a/lib/services/cashfusion/encrypt.dart b/lib/services/cashfusion/encrypt.dart index 2a6e00a6b..f6ffafe3e 100644 --- a/lib/services/cashfusion/encrypt.dart +++ b/lib/services/cashfusion/encrypt.dart @@ -121,16 +121,16 @@ Future<Tuple<Uint8List, Uint8List>> decrypt( // DOUBLE CHECK THIS IS RIGHT IDEA MATCHING PYTHON. ECPoint G = params.G; - var key; + final List<int> key; - if (privkey.d != null && noncePoint != null) { + if (privkey.d != null) { var point = (G * privkey.d)! + noncePoint; key = crypto.sha256.convert(Util.point_to_ser(point!, true)).bytes; // ... + var decryptedData = await decryptWithSymmkey(data, Uint8List.fromList(key)); + return Tuple(decryptedData, Uint8List.fromList(key)); } else { // Handle the situation where privkey.d or noncePoint is null + throw Exception("FIXME"); } - - var decryptedData = await decryptWithSymmkey(data, Uint8List.fromList(key)); - return Tuple(decryptedData, Uint8List.fromList(key)); }