Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bouillaguet Charles
pcg
Commits
8db7a322
Commit
8db7a322
authored
Dec 23, 2019
by
Bouillaguet Charles
Browse files
Options
Downloads
Patches
Plain Diff
introduction struct task_t : phase 2
parent
da6a3825
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cunknown/fonctions.c
+18
-12
18 additions, 12 deletions
Cunknown/fonctions.c
Cunknown/fonctions.h
+1
-0
1 addition, 0 deletions
Cunknown/fonctions.h
Cunknown/main.c
+1
-1
1 addition, 1 deletion
Cunknown/main.c
Cunknown/test_falsenegative.c
+1
-2
1 addition, 2 deletions
Cunknown/test_falsenegative.c
with
21 additions
and
15 deletions
Cunknown/fonctions.c
+
18
−
12
View file @
8db7a322
...
...
@@ -81,16 +81,6 @@ void getGoodY(char* goodY, const u64* X, const u64* lowSumPol, int v)
}
void
getTabTmp
(
u64
*
tabTmp
,
const
u64
*
X
,
const
u64
*
lowSumPol
,
const
u64
*
sumPolY
)
{
for
(
int
i
=
0
;
i
<
k
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nbiter
;
j
++
)
{
u64
uX
=
unrotate
(
X
[
j
],
i
);
tabTmp
[
i
*
nbiter
+
j
]
=
(((
lowSumPol
[
j
]
%
(
1
<<
known_low
))
^
(
uX
%
(
1
<<
known_low
)))
<<
known_up
)
+
(
i
^
(
uX
>>
(
k
-
known_up
)))
-
sumPolY
[
j
];
}
}
}
static
inline
int
checkY
(
const
char
*
goodY
,
int
i
,
u64
Y
)
{
int
idx
=
Y
+
i
*
(
1
<<
(
known_up
+
known_low
));
...
...
@@ -206,7 +196,9 @@ void pcg(pcg128_t *S, u64* X, pcg128_t S0, pcg128_t* c, int n)
void
init_task
(
struct
task_t
*
t
)
{
t
->
goodY
=
setupGoodY
();
t
->
goodY
=
malloc
((
1
<<
(
known_low
+
known_up
))
*
sizeof
(
char
)
*
nbtest
/
8
);
for
(
u64
y
=
0
;
y
<
nbtest
*
(
1
<<
(
known_low
+
known_up
))
/
8
;
y
++
)
t
->
goodY
[
y
]
=
0
;
}
...
...
@@ -220,8 +212,22 @@ void prepare_task(const u64 *X, u64 W0, u64 WC, struct task_t *t)
t
->
lowSumPol
[
nbiter
+
i
]
=
(
W0
*
((
u64
)
powA
[
i
+
nbiter
])
+
WC
*
((
u64
)
polA
[
i
+
nbiter
]));
t
->
sumPolTest
[
i
]
=
W0
*
((
u64
)
(
powA
[
i
+
nbiter
]
>>
known_low
)
-
1
)
+
WC
*
((
u64
)
(
polA
[
i
+
nbiter
]
>>
known_low
)
-
1
);
}
getGoodY
(
t
->
goodY
,
X
,
t
->
lowSumPol
,
1
);
getTabTmp
(
t
->
tabTmp
,
X
,
t
->
lowSumPol
,
t
->
sumPolY
);
// getTabTmp(t->tabTmp, X, t->lowSumPol, t->sumPolY);
for
(
int
i
=
0
;
i
<
k
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nbiter
;
j
++
)
{
u64
uX
=
unrotate
(
X
[
j
],
i
);
t
->
tabTmp
[
i
*
nbiter
+
j
]
=
(((
t
->
lowSumPol
[
j
]
%
(
1
<<
known_low
))
^
(
uX
%
(
1
<<
known_low
)))
<<
known_up
)
+
(
i
^
(
uX
>>
(
k
-
known_up
)))
-
t
->
sumPolY
[
j
];
}
}
for
(
int
i
=
0
;
i
<
nbiter
;
i
++
)
t
->
rot
[
i
]
=
0
;
}
void
finish_task
(
const
u64
*
X
,
struct
task_t
*
t
)
{
getGoodY
(
t
->
goodY
,
X
,
t
->
lowSumPol
,
0
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Cunknown/fonctions.h
+
1
−
0
View file @
8db7a322
...
...
@@ -38,6 +38,7 @@ struct task_t {
void
init_var_globales
();
void
init_task
(
struct
task_t
*
t
);
void
prepare_task
(
const
u64
*
X
,
u64
W0
,
u64
WC
,
struct
task_t
*
t
);
void
finish_task
(
const
u64
*
X
,
struct
task_t
*
t
);
double
wtime
();
static
inline
void
prodMatVecFFU
(
double
*
res
,
double
*
M
,
u64
*
v
,
int
n
){
...
...
This diff is collapsed.
Click to expand it.
Cunknown/main.c
+
1
−
1
View file @
8db7a322
...
...
@@ -50,7 +50,7 @@ int main()
printf("DS640 = %llu\n", DS640);
}*/
}
getGoodY
(
task
.
goodY
,
X
,
task
.
lowSumPol
,
0
);
finish_task
(
X
,
&
task
);
}
}
printf
(
"temps total = %f
\n
"
,
wtime
()
-
t1
);
...
...
This diff is collapsed.
Click to expand it.
Cunknown/test_falsenegative.c
+
1
−
2
View file @
8db7a322
...
...
@@ -31,7 +31,6 @@ int testValid (FILE* f, int n)
/**** Polynômes en WC et W0 utilisés dans la résolution ****/
int
a
=
solve_isgood
(
task
.
goodY
,
task
.
rot
,
task
.
tabTmp
,
task
.
sumPolY
,
task
.
sumPolTest
);
cpt
+=
a
;
if
(
a
)
{
...
...
@@ -41,7 +40,7 @@ int testValid (FILE* f, int n)
}
/* reset goodY */
getGoodY
(
task
.
goodY
,
X
,
task
.
lowSumPol
,
0
);
finish_task
(
X
,
&
task
);
}
return
cpt
;
}
...
...
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