Share records with the payload as a byte array #
The proven core keeps a share's payload as a List GF256, which costs 24 bytes of memory per
byte. PackedRecord is the same record with the payload as a ByteArray (1 byte per byte), and
combinePacked is combine reading the bytes straight from the arrays. combinePacked_eq
proves it returns exactly what combine returns on the shares of the packed records.
- setId : UInt32
Random identifier shared by all shares of one split.
- k : UInt8
The threshold of the split.
- x : GF256
The share index.
- fmt : Encoding.Fmt
The format version.
The share's token.
- payload : ByteArray
The share's payload, one byte per field element.
Instances For
Equations
Pack a record: the same fields, with the payload as a byte array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The payload of a packed record, as the list the core works on.
Instances For
The share of a packed record.
Instances For
Byte b of every position of the payloads, weighted by ws: the interpolation of
interpolateShares and interpolateSharesAt, reading the bytes from the arrays.
Equations
- One or more equations did not get rendered due to their size.
Instances For
combine on packed records: the same checks in the same order, and the same result
(combinePacked_eq).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of a packed record.
Equations
Instances For
combinePacked = combine #
Unpacking a packed record gives back the record's share.
The packed payload has one byte per field element.
interpolatePacked with the weights at 0 is interpolateShares.
interpolatePacked with the weights at z is interpolateSharesAt z.
combinePacked is combine on the shares of the packed records.
The plain fields of a packed record are the record's.
Packing the record of a packed record gives it back.
Unpacking a packed record gives the record back.
mapM in Except of a function followed by a map is mapM of the function, then the map
on every result.
The same, with the result as a byte array #
combinePacked still returns the rebuilt bytes as a list. combineBytes writes them into a byte
array and compares byte arrays, so nothing as long as the secret is ever a list.
A list of field elements as a byte array.
Equations
- QedShare.Cli.packBytes l = (List.map (fun (x : QedShare.GF256) => x.val) l).toByteArray
Instances For
Loop for interpolateBytes: bytes b, b + 1, … (n of them) are appended to acc.
Equations
- One or more equations did not get rendered due to their size.
- QedShare.Cli.interpolateInto ws ps 0 x✝¹ x✝ = x✝
Instances For
interpolatePacked, written into a byte array (interpolateBytes_eq).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Loop for sameByteArrays: the XOR of each pair of bytes is OR-ed into acc.
Equations
- QedShare.Cli.diffInto a b 0 x✝¹ x✝ = x✝
- QedShare.Cli.diffInto a b n.succ x✝¹ x✝ = QedShare.Cli.diffInto a b n (x✝¹ + 1) (x✝ ||| a.get! x✝¹ ^^^ b.get! x✝¹)
Instances For
sameBytes on byte arrays: equality without stopping at the first difference
(sameByteArrays_eq).
Equations
- QedShare.Cli.sameByteArrays a b = (a.size == b.size && QedShare.Cli.diffInto a b a.size 0 0 == 0)
Instances For
combine on packed records, with the rebuilt bytes as a byte array (combineBytes_eq).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bytes of a byte array, as a list, as a byte array again.
Reading the bytes of an array one by one gives the list of its bytes.
interpolateInto appends the interpolated bytes.
interpolateBytes is interpolatePacked, packed.
sameByteArrays is sameBytes on the lists of the bytes.
combineBytes is combinePacked, with the result packed.
Loops over a range of bytes #
Do the n bytes from position i all satisfy p?
Equations
- QedShare.Cli.allBytes p bs 0 x✝ = true
- QedShare.Cli.allBytes p bs n.succ x✝ = if p (bs.get! x✝) = true then QedShare.Cli.allBytes p bs n (x✝ + 1) else false