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
2a829ec8
Commit
2a829ec8
authored
5 years ago
by
Julia Sauvage
Browse files
Options
Downloads
Patches
Plain Diff
modifs julia
parent
0dfbd6cb
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cunknown/FindDS.sage
+1
-0
1 addition, 0 deletions
Cunknown/FindDS.sage
Cunknown/fonctions.c
+13
-4
13 additions, 4 deletions
Cunknown/fonctions.c
Cunknown/fonctions.h
+1
-1
1 addition, 1 deletion
Cunknown/fonctions.h
Cunknown/main.c
+3
-0
3 additions, 0 deletions
Cunknown/main.c
with
18 additions
and
5 deletions
Cunknown/FindDS.sage
+
1
−
0
View file @
2a829ec8
...
...
@@ -6,6 +6,7 @@ known_low = 11
a = 2549297995355413924 * 2^64 + 4865540595714422341
nboutput = 30
def sortiesGenerateur():#OK !
c = (r.randint(0, 2**(2 * k)) * 2 + 1) % 2**(2 * k) #c est impair
S=[r.randint(0,2**(k * 2))]
...
...
This diff is collapsed.
Click to expand it.
Cunknown/fonctions.c
+
13
−
4
View file @
2a829ec8
...
...
@@ -53,8 +53,10 @@ char * setupGoodY()
return
goodY
;
}
static
inline
void
setbit
(
char
*
goodY
,
int
i
dx
,
int
v
)
static
inline
void
setbit
(
char
*
goodY
,
int
i
,
unsigned
long
long
Y
,
int
v
)
{
// Y &= (1 << (known_up + known_low - 1));
int
idx
=
Y
+
i
*
(
1
<<
(
known_up
+
known_low
));
// idx = idx / 4;
int
j
=
idx
/
8
;
int
l
=
idx
%
8
;
...
...
@@ -72,8 +74,8 @@ void getGoodY(char* goodY, unsigned long long* tabX, unsigned long long* lowSumP
unsigned
long
long
Xij
=
tabX
[
i
*
k
+
j
];
//unrotate(X[i], j);
unsigned
long
long
goodYi1
=
(((
Xij
%
(
1
<<
known_low
))
^
Wi
)
<<
known_up
)
^
(
j
^
(
Xij
>>
(
k
-
known_up
)));
unsigned
long
long
goodYi2
=
(
goodYi1
-
1
)
%
(
1
<<
(
known_low
+
known_up
));
setbit
(
goodY
,
goodYi1
+
i
*
(
1
<<
(
known_low
+
known_up
))
,
v
);
setbit
(
goodY
,
goodYi2
+
i
*
(
1
<<
(
known_low
+
known_up
))
,
v
);
setbit
(
goodY
,
i
,
goodYi1
,
v
);
setbit
(
goodY
,
i
,
goodYi2
,
v
);
}
}
}
...
...
@@ -93,6 +95,7 @@ void getTabTmp(unsigned long long* tabTmp, unsigned long long* X, unsigned long
static
inline
int
checkY
(
const
char
*
goodY
,
int
i
,
unsigned
long
long
Y
)
{
// Y = Y(1 << (known_up + known_low - 1));
int
idx
=
Y
+
i
*
(
1
<<
(
known_up
+
known_low
));
// idx = idx / 4;
int
j
=
idx
/
8
;
...
...
@@ -103,7 +106,13 @@ static inline int checkY(const char* goodY, int i, unsigned long long Y)
static
inline
int
confirm
(
unsigned
long
long
Y0
,
unsigned
long
long
DS640
,
const
unsigned
long
long
*
sumPolTest
,
const
char
*
goodY
)
{
/**** Confirmation du DS640 ****/
for
(
int
i
=
0
;
i
<
nbtest
;
i
++
)
{
unsigned
long
long
tmp2
=
((
unsigned
long
long
)
polA
[
nbiter
])
*
DS640
+
sumPolTest
[
0
];
//ATTENTION cast pcg128_t
unsigned
long
long
Yi1
=
(
Y0
+
(
tmp2
>>
(
k
-
known_low
-
known_up
)))
%
(
1
<<
(
known_low
+
known_up
));
//avec ou sans retenue OK!
if
(
!
(
checkY
(
goodY
,
0
,
Yi1
)))
return
0
;
for
(
int
i
=
1
;
i
<
nbtest
;
i
++
)
{
unsigned
long
long
tmp2
=
((
unsigned
long
long
)
polA
[
i
+
nbiter
])
*
DS640
+
sumPolTest
[
i
];
//ATTENTION cast pcg128_t
unsigned
long
long
Yi1
=
(
Y0
+
(
tmp2
>>
(
k
-
known_low
-
known_up
)))
%
(
1
<<
(
known_low
+
known_up
));
//avec ou sans retenue OK!
if
(
!
(
checkY
(
goodY
,
i
,
Yi1
)))
{
...
...
This diff is collapsed.
Click to expand it.
Cunknown/fonctions.h
+
1
−
1
View file @
2a829ec8
...
...
@@ -9,7 +9,7 @@
/***** Macro et Variables globales *****/
#define k 64
#define known_up 6
#define known_low 13
#define known_low
11 //à relancer 3 fois, sur des X differents (X0 - X4 ,X5 - X9,...) puis lancé avec 12 et enfin
13
#define nbiter 5
#define nboutput 31
#define nbtest 3
...
...
This diff is collapsed.
Click to expand it.
Cunknown/main.c
+
3
−
0
View file @
2a829ec8
...
...
@@ -16,6 +16,8 @@ int main(){
pcg128_t
vraiS
[
nboutput
];
unsigned
long
long
X
[
nboutput
];
FILE
*
f
=
fopen
(
"results"
,
"w"
);
//printVal(S0, c);
pcg
(
vraiS
,
X
,
S0
,
&
c
,
nboutput
);
...
...
@@ -69,6 +71,7 @@ int main(){
}
if
(
solve_isgood
(
goodY
,
rot
,
tabTmp
,
sumPolY
,
sumPolTest
))
{
fprintf
(
f
)
solve
(
&
DS640
,
&
Y0
,
goodY
,
rot
,
tabTmp
,
sumPolY
,
sumPolTest
);
printf
(
"candidat DS64 trouvé !!
\n
"
);
printf
(
"%llu
\n
"
,
DS640
);
...
...
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