From 3556c98346683f0099b1847e954c5479e6218968 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 18 Aug 2019 14:22:55 +0100 Subject: [PATCH] Tweak to canonicalization section. --- TUTORIAL.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TUTORIAL.org b/TUTORIAL.org index 823b1a7..af1568b 100644 --- a/TUTORIAL.org +++ b/TUTORIAL.org @@ -169,7 +169,7 @@ out the elements in the same order, every time. When combined with binary serialization, this is Preserves' "canonical form". This is important and useful for many contexts, but especially for -cryptographic signatures. +cryptographic signatures and hashing. #+BEGIN_SRC preserves @"This hand-typed Preserves document..." @@ -185,8 +185,10 @@ cryptographic signatures. "noise": "ooh-ooh"}} #+END_SRC -This is a bit more expensive than normal serialization (because -sorting needs to occur), but is still quite fast in general. +Clever implementations can get canonicalized output for free by +carefully ordering set elements and dictionary entries at construction +time, but even in simple implementations, canonical serialization is +almost as cheap as normal serialization. ** Defining our own types using Records