Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (22 sloc) 0.792 kB
Implementation of a btree based merkle tree. The original merkle tree would not scale out to a large number of keys due to the limitation of keeping the tree in main memory. Therefore we will try and store the
btree file:
file header: version:1, blocksize:32, freepointer:64, rootpointer:64,
freekeys1:64, freekeys2:64, freekeys3:64, freekeys4:64, freekeys5:64
reserved/bytes:
header size: 85
node:{0,m:32,[keyhash:32],[childhash:32,child:64]}
leaf:{1,m:32,[keyhash:32,keypointer:64,valhash:32]}
freenode:{2,nextpointer:64,0:(blocksize-9)}
for nodes:
blocksize = 1 + 4 + D*4 + (D+1)*12
D = (blocksize-17)/16
for leaves:
blocksize = 5 + D*16
D = (blocksize-5)/16
65521
key file:
[key\0,key\0,key\0]
keys allocation
l = 2**4
m = 2**64
header size = 85 + (√blocksize - 4)*8
Jump to Line
Something went wrong with that request. Please try again.