Browse Source

(Squash this) forgot to say that algo_name should be length prefixed

pull/2096/head
ValarDragon 6 years ago
parent
commit
caef5dcd69
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      docs/architecture/adr-015-symmetric-crypto.md

+ 4
- 1
docs/architecture/adr-015-symmetric-crypto.md View File

@ -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 {


Loading…
Cancel
Save