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
8
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
809a2f03
Verified
Commit
809a2f03
authored
6 months ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
measure times
parent
fdacd726
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/fri.rs
+15
-1
15 additions, 1 deletion
examples/fri.rs
with
15 additions
and
1 deletion
examples/fri.rs
+
15
−
1
View file @
809a2f03
...
...
@@ -3,6 +3,7 @@ use ark_poly::univariate::DensePolynomial;
use
ark_poly
::
DenseUVPolynomial
;
use
ark_std
::
ops
::
Div
;
use
rs_merkle
::
Hasher
;
use
std
::
time
::{
Duration
,
Instant
};
use
fri
::
algorithms
::
Blake3
;
use
fri_test_utils
::
Fq
;
...
...
@@ -21,13 +22,26 @@ where
for
<
'a
,
'b
>
&
'a
P
:
Div
<&
'b
P
,
Output
=
P
>
,
<
H
as
rs_merkle
::
Hasher
>
::
Hash
:
AsRef
<
[
u8
]
>
,
{
eprintln!
(
"evaluation"
);
let
start_time
=
Instant
::
now
();
let
evaluations
=
komodo
::
fri
::
evaluate
::
<
F
>
(
&
bytes
,
k
,
n
);
let
shards
=
komodo
::
fri
::
encode
::
<
F
>
(
&
bytes
,
evaluations
.clone
(),
k
,
n
);
eprintln!
(
"{:?}"
,
Instant
::
now
()
.duration_since
(
start_time
));
eprintln!
(
"encoding"
);
let
evals
=
evaluations
.clone
();
let
start_time
=
Instant
::
now
();
let
shards
=
komodo
::
fri
::
encode
::
<
F
>
(
&
bytes
,
evals
,
k
,
n
);
eprintln!
(
"{:?}"
,
Instant
::
now
()
.duration_since
(
start_time
));
eprintln!
(
"proving"
);
let
start_time
=
Instant
::
now
();
let
blocks
=
komodo
::
fri
::
prove
::
<
N
,
F
,
H
,
P
>
(
evaluations
,
shards
,
bf
,
rpo
,
q
)
.unwrap
();
eprintln!
(
"{:?}"
,
Instant
::
now
()
.duration_since
(
start_time
));
eprintln!
(
"verifying"
);
let
start_time
=
Instant
::
now
();
for
block
in
blocks
{
komodo
::
fri
::
verify
::
<
N
,
F
,
H
,
P
>
(
block
,
n
,
q
)
.unwrap
();
}
eprintln!
(
"{:?}"
,
Instant
::
now
()
.duration_since
(
start_time
));
Ok
(())
}
...
...
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