From 5c542bb09e51eeb407a59f5bd4a2c6c460863446 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Apr 2017 12:01:20 -0400 Subject: switch wire message seralization to use protocol buffers This way it's not tied to details of the haskell binary library, and implementations in other languages should be fairly simple to do. The haskell protobuf library was used because it does not need extra tooling or build steps. So I didn't write a .proto file, but one could fairly easily be written by following ProtocolBuffers.hs and translating it. ProtocolBuffers.hs is *extremely* repetative and tedious code. Surely there must be a way to not need to write all of that? Oh well, I wrote it.. Sizes of serialized messages: ">>> debug-me session started": 121 sending a single key press: 169 This seems equally as efficient as the binary serialization was; that was 165 bytes before elapsedTime was added. This commit was sponsored by Ethan Aubin. --- Crypto.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Crypto.hs') diff --git a/Crypto.hs b/Crypto.hs index b23c8de..1c898e7 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -5,7 +5,7 @@ module Crypto where import Val import Hash import Types -import Serialization +import JSON import qualified Crypto.PubKey.Ed25519 as Ed25519 import Crypto.Error -- cgit v1.2.3