Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈家乐
jiancetai
Commits
c79d9ef8
Commit
c79d9ef8
authored
Dec 04, 2025
by
李鑫3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:替换新解锁算法
parent
fa844caa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
35 deletions
+27
-35
CAN_APP.c
YueJin_test_bench/source/Appliciation/CAN_APP.c
+24
-34
CAN_APP.h
YueJin_test_bench/source/Appliciation/CAN_APP.h
+2
-0
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+1
-1
No files found.
YueJin_test_bench/source/Appliciation/CAN_APP.c
View file @
c79d9ef8
...
@@ -1982,37 +1982,27 @@ void Get_UID_msg(void)
...
@@ -1982,37 +1982,27 @@ void Get_UID_msg(void)
uint32_t
ValidSeedKey
;
uint32_t
ValidSeedKey
;
const
uint32_t
diagKeyP2
=
0x8ADB2275
;
const
uint32_t
diagKeyP1
=
0x354EAF42
;
uint8_t
Key
[
4
];
uint8_t
seed_result
[
4
];
uint32_t
GenerateKey
(
uint8_t
*
Seed
)
uint32_t
GenerateKey
(
uint8_t
*
Seed
)
{
{
uint8_t
Key
[
4
];
uint32_t
seed_val
=
0
;
uint8_t
i
;
union
{
seed_val
=
((
uint32_t
)
Seed
[
3
]
<<
24u
)
+
((
uint32_t
)
Seed
[
2
]
<<
16u
)
+
((
uint32_t
)
Seed
[
1
]
<<
8u
)
+
((
uint32_t
)
Seed
[
0
]);
uint8_t
byte
[
4u
];
uint32_t
wort
;
uint32_t
temp
=
seed_val
*
diagKeyP2
;
}
seedlokal
;
temp
=
diagKeyP1
^
temp
;
const
uint32_t
mask
=
0xA0BDDFA0u
;
Key
[
0
]
=
(
uint8_t
)(
temp
);
seedlokal
.
wort
=
((
uint32_t
)
Seed
[
0u
]
<<
24u
)
+
((
uint32_t
)
Seed
[
1u
]
<<
16u
)
+
((
uint32_t
)
Seed
[
2u
]
<<
8u
)
+
(
uint32_t
)
Seed
[
3u
];
Key
[
1
]
=
(
uint8_t
)((
temp
>>
8u
))
;
for
(
i
=
0u
;
i
<
35u
;
i
++
)
Key
[
2
]
=
(
uint8_t
)((
temp
>>
16u
));
{
Key
[
3
]
=
(
uint8_t
)((
temp
>>
24u
));
if
(
seedlokal
.
wort
&
0x80000000u
)
{
ValidSeedKey
=
((
uint32_t
)
Key
[
3
]
<<
24u
)
+
((
uint32_t
)
Key
[
2
]
<<
16u
)
+
((
uint32_t
)
Key
[
1
]
<<
8u
)
+
((
uint32_t
)
Key
[
0
]);
seedlokal
.
wort
=
seedlokal
.
wort
<<
1u
;
seedlokal
.
wort
=
seedlokal
.
wort
^
mask
;
}
else
{
seedlokal
.
wort
=
seedlokal
.
wort
<<
1u
;
}
}
for
(
i
=
0u
;
i
<
4u
;
i
++
)
{
Key
[
3u
-
i
]
=
seedlokal
.
byte
[
i
];
}
ValidSeedKey
=
((
uint32_t
)
Key
[
0u
]
<<
24u
)
+
((
uint32_t
)
Key
[
1u
]
<<
16u
)
+
((
uint32_t
)
Key
[
2u
]
<<
8u
)
+
((
uint32_t
)
Key
[
3u
]
);
return
ValidSeedKey
;
return
ValidSeedKey
;
...
@@ -2348,14 +2338,14 @@ void get_seed_msg(void)
...
@@ -2348,14 +2338,14 @@ void get_seed_msg(void)
{
{
memcpy
(
seednum
,
&
u8get714msg
[
3
],
4
);
memcpy
(
seednum
,
&
u8get714msg
[
3
],
4
);
testseed
=
GenerateKey
(
seednum
);
testseed
=
GenerateKey
(
seednum
);
seedresult
[
0
]
=
(
uint8_t
)(
testseed
>>
24
);
seedresult
[
3
]
=
(
uint8_t
)(
testseed
>>
24
);
seedresult
[
1
]
=
(
uint8_t
)(
testseed
>>
16
);
seedresult
[
2
]
=
(
uint8_t
)(
testseed
>>
16
);
seedresult
[
2
]
=
(
uint8_t
)(
testseed
>>
8
);
seedresult
[
1
]
=
(
uint8_t
)(
testseed
>>
8
);
seedresult
[
3
]
=
(
uint8_t
)
testseed
;
seedresult
[
0
]
=
(
uint8_t
)
testseed
;
getseedresult
=
1
;
getseedresult
=
1
;
}
}
getseedresult
=
1
;
//
getseedresult = 1;
}
}
uint8_t
opentrackstep
=
0
;
uint8_t
opentrackstep
=
0
;
void
Opentracksta
(
void
)
void
Opentracksta
(
void
)
...
...
YueJin_test_bench/source/Appliciation/CAN_APP.h
View file @
c79d9ef8
...
@@ -81,4 +81,6 @@ extern uint8_t H630BUFFER[10];
...
@@ -81,4 +81,6 @@ extern uint8_t H630BUFFER[10];
extern
uint8_t
BOOT2
[
9
];
extern
uint8_t
BOOT2
[
9
];
extern
uint8_t
HWin
[
5
];
extern
uint8_t
HWin
[
5
];
extern
uint8_t
HWout
[
8
];
extern
uint8_t
HWout
[
8
];
extern
const
uint32_t
diagKeyP1
;
extern
const
uint32_t
diagKeyP2
;
#endif
#endif
YueJin_test_bench/source/Appliciation/Task.c
View file @
c79d9ef8
...
@@ -311,7 +311,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
...
@@ -311,7 +311,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
if
((
rightflg
==
1
)
&&
(
leftflg
==
1
))
if
((
rightflg
==
1
)
&&
(
leftflg
==
1
))
{
{
igoff
++
;
igoff
++
;
if
(
igoff
==
6
0
)
if
(
igoff
==
11
0
)
{
{
POWER_CTRL_KL30
=
0u
;
//B+
POWER_CTRL_KL30
=
0u
;
//B+
POWER_CTRL_KL15
=
0u
;
//KL15
POWER_CTRL_KL15
=
0u
;
//KL15
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment