mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-04 22:43:12 +00:00
formatting: use just one type section
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
47985bb2d8
commit
964276f53f
@ -86,29 +86,35 @@ import ../rng
|
||||
# which is 255 bits long for BLS12-381
|
||||
const bytespersector = 31
|
||||
|
||||
# a single sector
|
||||
type ZChar = array[bytespersector, byte]
|
||||
type
|
||||
# a single sector
|
||||
ZChar = array[bytespersector, byte]
|
||||
|
||||
# secret key combining the metadata signing key and the POR generation key
|
||||
type SecretKey = object
|
||||
signkey: blscurve.SecretKey
|
||||
key: blst_scalar
|
||||
# secret key combining the metadata signing key and the POR generation key
|
||||
SecretKey = object
|
||||
signkey: blscurve.SecretKey
|
||||
key: blst_scalar
|
||||
|
||||
# public key combining the metadata signing key and the POR validation key
|
||||
type PublicKey = object
|
||||
signkey: blscurve.PublicKey
|
||||
key: blst_p2
|
||||
# public key combining the metadata signing key and the POR validation key
|
||||
PublicKey = object
|
||||
signkey: blscurve.PublicKey
|
||||
key: blst_p2
|
||||
|
||||
# POR metadata
|
||||
type TauZero = object
|
||||
name: array[512,byte]
|
||||
n: int64
|
||||
u: seq[blst_p1]
|
||||
# POR metadata
|
||||
TauZero = object
|
||||
name: array[512,byte]
|
||||
n: int64
|
||||
u: seq[blst_p1]
|
||||
|
||||
# signed POR metadata
|
||||
type Tau = object
|
||||
t: TauZero
|
||||
signature: array[96, byte]
|
||||
# signed POR metadata
|
||||
Tau = object
|
||||
t: TauZero
|
||||
signature: array[96, byte]
|
||||
|
||||
# PoR query element
|
||||
QElement = object
|
||||
I: int64
|
||||
V: blst_scalar
|
||||
|
||||
proc fromBytesBE(a: array[32, byte]): blst_scalar =
|
||||
## Convert data to blst native form
|
||||
@ -271,10 +277,6 @@ proc setup*(ssk: SecretKey, s:int64, filename: string): (Tau, seq[blst_p1]) =
|
||||
file.close()
|
||||
result = (tau, sigmas)
|
||||
|
||||
type QElement = object
|
||||
I: int64
|
||||
V: blst_scalar
|
||||
|
||||
proc generateQuery*(tau: Tau, spk: PublicKey, l: int): seq[QElement] =
|
||||
## Generata a random BLS query of given sizxe
|
||||
let n = tau.t.n # number of blocks
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user