* Add Proving object, which maintains contract id's to watch
* [proving] invoke callback when proof is required
# Conflicts:
# dagger/por/timing/periods.nim
# dagger/por/timing/prooftiming.nim
* [proving] check proof requirements for all our contracts
# Conflicts:
# tests/dagger/helpers/mockprooftiming.nim
* Update vendor/dagger-contracts
* [proving] call onProofRequired() when proof is required soon
* [proving] stop checking contracts that have ended
* [proving] Remove duplicated funcs
* [proving] Implement ProofTiming on top of smart contract
* [proving] Fix race condition in waitUntilNextPeriod()
Sometimes waitUntilNextPeriod would take a while to
determine the current period, leading to unexpected results.
Splits waitUntilNextPeriod() into getCurrentPeriod()
and waitUntilPeriod(), to ensure that we're really waiting
for the period that we think we're waiting for.
* wip: adding request for storage endpoint
* wire in erasure coding
* fix tests for erasure coding
* put type definitions into separate file
* integrate erasure coding
* change run/shutdown to start/stop
* temporary sleep, otherwise the fsstore blocks
* use storestream for retrieval
* use `len` prop on manifest
* remove read pattern
* make blocksize and chunksize consistent
* fix tests
* fix chunker tests - now padded by default
* initial commit of the Shacham RSA-based public scheme
Minimal working version with lots of error checks and corrections
still needed.
- using Bearssl RSA code through libp2p
- with selecteble BigInt library for experimentation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* better proc names
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* separating demo code from library
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* using normal file io instead of memfiles
mmap has serveral potential issues and we do not really need it, so
changing to use the normal system file interface is better.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* draft version of bls proofs
Implementation of the BLS-based public PoS scheme from
Shacham H., Waters B., "Compact Proofs of Retrievability"
using pairing over BLS12-381 ECC
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* draft test and benchmark code for BLS PoS
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* improve documentation of BLS scheme
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* fix getSector
* fixing DST tag in hashToG1
The DST tag should be unique to achieve domain separation
of hash functions as defined in:
https://tools.ietf.org/id/draft-irtf-cfrg-hash-to-curve-06.html#domain-separation
Changed DST tag to one that indicates the PoC status of this code.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* add verifyPairings abstraction
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* change random number generator to a secure one
Use Rng based on BrHmacDrbgContext
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* fix benchmark template
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* exchange parameter order in pairing
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* add optimized verifyPairing implementation
When verifying two pairings, one final exponentiation
can be spared through the use of cneg.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* speed up tag generation by a factor of s
Scalar multiplications in tag generation can be rearranged
to benefit from the way random points are being generated.
Since random points are themselves generated using scalar
multiplication and the base is common, the sum of multiplications
becomes a single multiplication with the scalar sum, resulting in
a nice speedup.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* use blst_p1_add_or_double instead of blst_p1_add
blst exposes two add functions: one that works for the corner case
of doubling, and one that isn't. It seems safer to use the one that
works, even if it is highly improbable in these cases that doubling
would occur.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* sectorsperblock should be an external parameter
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* parametrize sectorsblock and querylen
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* improving benchmark messages
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* rebasing main
* generateAuthenticator: remove unused ubase parameter from naive impl
No need to have the same interface on the two implementations, so
we can remove this parameter.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* generateAuthenticator: add some more explanation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* renaming pos.nim to rsa.nim
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* sign and verify metadata in Tau
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* adding more comments
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* remove code of slow RSA based version
Removed RSA-based version to ease maintenance, as it is
highly unlikely we would use it.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* formatting: use just one type section
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* more comments added
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* make `namelen` a const
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* generalize hashToG1
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* hashNameI: switch to faster implementation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Tanguy <tanguy@status.im>
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
* feat: introduce LRU cache
Replace `MemoryStore` with LRU caching mechanism.
`lrucache` library was forked to https://github.com/status-im/lrucache.nim.
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
# Conflicts:
# dagger/dagger.nim
# dagger/stores.nim
# dagger/stores/manager.nim
# tests/dagger/blockexc/testengine.nim
# tests/dagger/helpers/nodeutils.nim
# tests/dagger/testnode.nim
# tests/dagger/teststores.nim
* feat: introduce --cache-size CLI option
Allow for a value of `0` to disable the cache.
# Conflicts:
# dagger/dagger.nim
* allow dynamic block size in cache
allow block size to be variable/dynamic
update lrucache to use updated lrucache dep
Using removeLru proc, added tests
* Refactor CacheStore init block
Co-authored-by: Michael Bradley, Jr <michaelsbradleyjr@gmail.com>