Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Komodo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
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
7aca99fa
Verified
Commit
7aca99fa
authored
7 months ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
WIP: make it compile
parent
27ce308c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fri.rs
+19
-19
19 additions, 19 deletions
src/fri.rs
with
19 additions
and
19 deletions
src/fri.rs
+
19
−
19
View file @
7aca99fa
use
ark_ff
::
PrimeField
;
use
ark_poly
::
DenseUVPolynomial
;
use
ark_std
::{
ops
::
Div
,
rand
::{
thread_rng
,
Rng
},
};
use
ark_std
::
ops
::
Div
;
use
rs_merkle
::
Hasher
;
use
tracing
::{
debug
,
info
};
use
crate
::{
algebra
,
error
::
KomodoError
,
fec
};
use
fri
::{
frida
::{
FridaBuilder
,
FridaCommitment
},
frida
::{
nth_evaluations
,
FridaBuilder
,
FridaCommitment
},
rng
::
FriChallenger
,
utils
::{
to_evaluations
,
HasherExt
,
MerkleProof
},
};
...
...
@@ -67,17 +64,22 @@ where
Ok
(
shards
.iter
()
.map
(|
s
|
Block
{
shard
:
s
.clone
(),
proof
:
builder
.prove_shards
(
&
[
s
.map
(|
s
|
{
// TODO: compute true position
let
position
=
0
;
let
_pos
=
s
.linear_combination
.iter
()
.filter
(|
x
|
!
x
.is_zero
())
.cloned
()
.collect
::
<
Vec
<
F
>>
()
.first
()
.unwrap
()
.into
()]),
commit
:
commit
.clone
(),
.unwrap
();
Block
{
shard
:
s
.clone
(),
proof
:
builder
.prove_shards
(
&
[
position
]),
commit
:
commit
.clone
(),
}
})
.collect
())
}
...
...
@@ -86,8 +88,6 @@ pub fn verify<const N: usize, F: PrimeField, H: Hasher, P>(
block
:
Block
<
F
,
H
>
,
k
:
usize
,
domain_size
:
usize
,
blowup_factor
:
usize
,
remainder_plus_one
:
usize
,
nb_queries
:
usize
,
)
->
Result
<
(),
KomodoError
>
where
...
...
@@ -97,14 +97,14 @@ where
{
block
.commit
.verify
::
<
N
,
_
>
(
FriChallenger
::
<
H
>
::
default
(),
nb_queries
,
nb_coeffs
,
domain_size
,
)
.verify
::
<
N
,
_
>
(
FriChallenger
::
<
H
>
::
default
(),
nb_queries
,
k
,
domain_size
)
.unwrap
();
// TODO: compute true position
let
position
=
0
;
// TODO: compute true evaluations
let
evaluations
:
Vec
<
Vec
<
F
>>
=
vec!
[];
assert!
(
block
.proof
.verify
(
block
.commit
.tree_root
(),
&
[
position
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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