From caef5dcd6953f47f661dbbea6dc5102530d5a643 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Sat, 28 Jul 2018 04:14:07 -0700 Subject: [PATCH] (Squash this) forgot to say that algo_name should be length prefixed --- docs/architecture/adr-015-symmetric-crypto.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/architecture/adr-015-symmetric-crypto.md b/docs/architecture/adr-015-symmetric-crypto.md index e798f8492..166d99c0f 100644 --- a/docs/architecture/adr-015-symmetric-crypto.md +++ b/docs/architecture/adr-015-symmetric-crypto.md @@ -44,7 +44,10 @@ One downside is that for the encrypt function you must have already initialized but I don't really see this as an issue. If there is no error in encryption, EncryptSymmetric will return `algo_name || nonce || aead_ciphertext`. -This requires a mapping from aead type to name. +`algo_name` should be length prefixed, using standard varuint encoding. +This will be binary data, but thats not a problem considering the nonce and ciphertext are also binary. + +This solution requires a mapping from aead type to name. We can achieve this via reflection. ```golang func getType(myvar interface{}) string {