Add 'spec.md'

master
Semisol 2021-11-18 01:17:29 +01:00
parent bbc222d793
commit f2dd0ff0ec
No known key found for this signature in database
GPG Key ID: 474E777CEDBA3FE1
1 changed files with 21 additions and 0 deletions

21
spec.md Normal file
View File

@ -0,0 +1,21 @@
## Unencrypted
The packet contains 6-byte set instructions. There may be multiple instructions, concatenated together.
An instruction is:
```
12 bits - x
12 bits - y
24 bits - rgb
```
## Encrypted
The encrypted protocol works by encapsulating an unencrypted packet.
The format is as follows:
```
32 bytes - An X25519 public key.
24 bytes - Cipher nonce.
16 bytes - MAC
rest - Ciphertext
```
Please note that all operations are being done with the [Monocypher](https://monocypher.org) library.
Implementations using other libraries may be incompatible.