Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Komodo
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dragoon
Komodo
Commits
c7f6af78
Verified
Commit
c7f6af78
authored
6 months ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
add example
parent
9a8acbf7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cargo.toml
+4
-0
4 additions, 0 deletions
Cargo.toml
examples/fri.rs
+31
-0
31 additions, 0 deletions
examples/fri.rs
with
35 additions
and
0 deletions
Cargo.toml
+
4
−
0
View file @
c7f6af78
...
...
@@ -55,3 +55,7 @@ required-features = ["kzg"]
[[example]]
name
=
"aplonk"
required-features
=
[
"aplonk"
]
[[example]]
name
=
"fri"
required-features
=
[
"fri"
]
This diff is collapsed.
Click to expand it.
examples/fri.rs
0 → 100644
+
31
−
0
View file @
c7f6af78
use
ark_bls12_381
::
Fr
;
use
ark_ff
::
PrimeField
;
use
ark_poly
::
univariate
::
DensePolynomial
;
use
ark_poly
::
DenseUVPolynomial
;
use
ark_std
::
ops
::
Div
;
use
rs_merkle
::
Hasher
;
use
fri
::
algorithms
::
Blake3
;
use
komodo
::
error
::
KomodoError
;
fn
run
<
F
:
PrimeField
,
H
:
Hasher
,
P
>
()
->
Result
<
(),
KomodoError
>
where
P
:
DenseUVPolynomial
<
F
>
,
for
<
'a
,
'b
>
&
'a
P
:
Div
<&
'b
P
,
Output
=
P
>
,
<
H
as
rs_merkle
::
Hasher
>
::
Hash
:
AsRef
<
[
u8
]
>
,
{
// the code parameters and the data to manipulate
let
(
k
,
n
)
=
(
4
,
16
);
let
bytes
=
include_bytes!
(
"../assets/dragoon_133x133.png"
)
.to_vec
();
eprintln!
(
"loaded {} bytes of data"
,
bytes
.len
());
let
shards
=
komodo
::
fri
::
encode
::
<
F
>
(
&
bytes
,
k
,
n
);
let
blocks
=
komodo
::
fri
::
prove
::
<
2
,
F
,
H
,
P
>
(
shards
,
1
,
1
,
50
)
.unwrap
();
komodo
::
fri
::
verify
::
<
2
,
F
,
H
,
P
>
(
blocks
[
0
]
.clone
(),
n
,
50
)
.unwrap
();
Ok
(())
}
fn
main
()
{
run
::
<
Fr
,
Blake3
,
DensePolynomial
<
Fr
>>
()
.unwrap
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment