From 964276f53fbf2c3dacd378f1daf0bbda4b009d3c Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 24 Nov 2021 10:52:55 +0100 Subject: [PATCH] formatting: use just one type section Signed-off-by: Csaba Kiraly --- dagger/storageproofs/bls.nim | 48 +++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/dagger/storageproofs/bls.nim b/dagger/storageproofs/bls.nim index 88cdf25e..71dc3cd2 100644 --- a/dagger/storageproofs/bls.nim +++ b/dagger/storageproofs/bls.nim @@ -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