aboutsummaryrefslogtreecommitdiffstats
path: root/notes
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-16 18:58:24 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-16 18:58:24 -0700
commitbde2282d17474783d83a1e538beaaaff296115b7 (patch)
tree10ee31ffa370da8b80b7ba889bb3daa81f2ea34d /notes
parentf565666eaffd3d442390bf9491fabcae15d9a08d (diff)
downloadgeniza-bde2282d17474783d83a1e538beaaaff296115b7.tar.gz
geniza-bde2282d17474783d83a1e538beaaaff296115b7.zip
initial structure
Diffstat (limited to 'notes')
-rw-r--r--notes/register.md22
-rw-r--r--notes/sleep.md37
2 files changed, 59 insertions, 0 deletions
diff --git a/notes/register.md b/notes/register.md
new file mode 100644
index 0000000..f036543
--- /dev/null
+++ b/notes/register.md
@@ -0,0 +1,22 @@
+
+### SLEEP File Types
+
+ key
+ no header, raw bytes
+ tree
+ magic: 0x05025702
+ entry-size: 40 bytes
+ algorithm name: 'BLAKE2b' (len=7)
+ entry: 32-byte BLAKE2b node hash + 8-byte Uint64BE length
+ data
+ no header, raw bytes
+ signatures
+ magic: 0x05025701
+ entry-size: 65
+ algorithm name: 'Ed25519' (len=7)
+ entry: 64-byte Ed25519 signature
+ bitfield
+ magic: 0x05025700
+ entry-size: 3328
+ algorithm name: '' (len=0)
+ entry: 1024 bytes data, 2048 bytes tree, 256 bitfield
diff --git a/notes/sleep.md b/notes/sleep.md
new file mode 100644
index 0000000..d13a489
--- /dev/null
+++ b/notes/sleep.md
@@ -0,0 +1,37 @@
+
+### Binary Header
+
+Fixed 32-bytes
+
+ -----------------------------------------------------------------
+ | MAGIC |
+ -----------------------------------------------------------------
+ | VERSION (0) | ENTRY SIZE (uint16BE) | ALGO NAME LEN |
+ -----------------------------------------------------------------
+ | |
+ | |
+ | |
+ | ALGORITHM NAME (lower-case string) |
+ | |
+ | |
+ -----------------------------------------------------------------
+
+
+ PREFIX LEN is max 24 (bytes)
+
+ offset: 32 + entrySize * entryIndex
+ count: (fileSize - 32) / entrySize
+
+
+### SLEEP API
+
+ SleepStorage trait
+ SleepFile struct/impl
+
+ get_magic() -> u32
+ get_algorithm() -> &str
+ read(index) -> &bytes[]
+ write(index, &bytes[])
+ length() -> u64
+
+ First time around just do regular file seek() stuff