import 'dart:async'; import 'package:veilid/veilid.dart'; import 'dart:typed_data'; import 'tools.dart'; typedef DHTRecordEncryptionFactory = DHTRecordEncryption Function(); abstract class DHTRecordEncryption { factory DHTRecordEncryption.private() { return DHTRecordEncryptionPrivate(); } factory DHTRecordEncryption.public() { return DHTRecordEncryptionPublic(); } FutureOr encrypt(Uint8List data); FutureOr decrypt(Uint8List data); } //////////////////////////////////// /// Private DHT Record: Encrypted with the owner's secret key class DHTRecordEncryptionPrivate implements DHTRecordEncryption { DHTRecordEncryptionPrivate() { // } @override FutureOr encrypt(Uint8List data) { // } @override FutureOr decrypt(Uint8List data) { // } } //////////////////////////////////// /// Public DHT Record: No encryption class DHTRecordEncryptionPublic implements DHTRecordEncryption { DHTRecordEncryptionPublic() { // } @override FutureOr encrypt(Uint8List data) { return data; } @override FutureOr decrypt(Uint8List data) { return data; } }