input-output-hk / scrypto Goto Github PK
View Code? Open in Web Editor NEWCryptographic primitives for Scala
License: Creative Commons Zero v1.0 Universal
Cryptographic primitives for Scala
License: Creative Commons Zero v1.0 Universal
Currently keys are stored during manifest and subtrees serialization in BatchAVLProverSerializer. However, they are not protected via collision-resistant hash function for internal nodes. Thus, currently verifier (calling verify() functions in BatchAVLProverManifest and BatchAVLProverSubtree) is blindly trusting the keys, which opens possibilities for adversaries.
So we need to whether avoid storing keys for internal nodes at all, or implement check (for subtrees, and for manifest(assuming bottom keys of subtrees are correct)).
Rework TreeTester into unit and property tests (do more tests than conversion assumes!)
As part of ergoplatform/sigma-rust implementation of BatchMerkleProof #538, I found a way to trigger stack overflow in BatchMerkleProof::valid implementation. After some testing, this issue occured in both the scala implementation and Rust. In loop() code, if a is empty, then it will still keep recursing and passing yet another empty array of indices to loop(). Here is a minimally failing example:
val batch = BatchMerkleProof(Seq(), Seq((Digest32 @@ Array.fill[Byte](32)(0),MerkleProof.LeftSide)))
batch.valid(Digest32 @@ Array.fill[Byte](32)(0))
2.13.1 is out. :)
(I can probably take this on)
Hi,
can't seem to find scrypto 2.0.0 for Scala 2.11.
Is there a plan to publish it?
Thanks
I've tried to follow the README using the version 1.2.1 but sbt can't find it, I've tried to look into sonatype and also in mavenrepository but can't find it either. Why it hasn't been published yet?
Scrypto has an implementation of AVL+ tree described in briefly in https://eprint.iacr.org/2016/994 , see BatchAVLProver/BatchAVLVerifier classes and further scorex.crypto.authds.avltree.batch package.
In particular, this tree is tailored for blockchain applications. See the presentation from RWC2017 https://www.youtube.com/watch?v=PHY7JnLrK5o
There's no detailed specification for the tree (construction, serialization) and proofs (algorithms, serialization) yet, but it is needed, as the tree is used in Ergo blockchain (core, contracts), and possibly , somewhere else.
Tests like this result to failure:
val manifestBytes = serializer.manifestToBytes(manifest)
val deserializedManifest = serializer.manifestFromBytes(manifestBytes).get
deserializedManifest shouldEqual manifest
assembly
not available after #98 got mergedSimilarly to scorex.crypto.authds.merkle.MerkleProof, make BatchMerkleProof for many elements in the tree.
After #98 got merged, publish/publishSigned is aborting with error like
[error] java.io.IOException: Server returned HTTP response code: 401 for URL: https://oss.sonatype.org/content/repositories/snapshots/org/scorexfoundation/scrypto_2.13/2.2.1-33-88372613-20230123-1543-SNAPSHOT/scrypto_2.13-2.2.1-33-88372613-20230123-1543-SNAPSHOT.jar
...
[error] java.lang.RuntimeException: Repository for publishing is not specified.
...
Extract to separate project (e.g. ScorexUtils
):
Check, that it follows https://github.com/ergoplatform/ergo/blob/tx-format/papers/yellow/main.pdf
Add scalastyle plugin, configure jenkins to check style after commits
When using org.scorexfoundation:scrypto_2.11:2.1.10
dependency, the build on Android fails:
Reason: IllegalArgumentException, message: Unsupported class file major version 59
It is needed to use org.bouncycastle:bcprov-jdk15to18:1.66 instead.
Allocate a lot of memory
The following cross-compilation targets should be supported:
JVM: Scala 2.11, 2.12, 2.13, 3.3.x
JS: Scala 2.13, 3.3.x (via latest Scala.js)
The dependencies should be consistent across downstream ScorexFoundation projects. See related PRs (ScorexFoundation/scorex-util#30, ScorexFoundation/debox#5) for concrete versions of deps that can be used, example configurations and typical code fixes.
Can start from enabling migration mode.
This test:
scrypto/shared/src/test/scala/scorex/crypto/hash/HashTest.scala
Lines 59 to 69 in 1d2db26
is not functional within scala 2.
This came up during work on
hash.DigestSize shouldBe 32
with a wrong value, the test will not fail.else { fail("Tag is not Digest32 or Digest64") }
to line 67Made binary serializer / deserializer
Implement arbitrary sized values in AVL+ trees
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.