Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
184cba42
Commit
184cba42
authored
Nov 05, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EEA3 refactor
parent
c1c06785
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/lib/crypt/eea3.cpp
src/lib/crypt/eea3.cpp
+9
-9
No files found.
src/lib/crypt/eea3.cpp
View file @
184cba42
...
...
@@ -9,6 +9,9 @@
#include "eea3.hpp"
#include "zuc.hpp"
#include <endian.h>
#include <vector>
namespace
crypto
::
eea3
{
...
...
@@ -61,17 +64,14 @@ uint32_t EIA3(const uint8_t *pKey, uint32_t count, uint32_t direction, uint32_t
z
=
new
uint32_t
[
L
];
ZUC
(
pKey
,
IV
,
z
,
L
);
uint32_t
data_htobe32
[
length
/
32
+
1
];
for
(
int
i
=
0
;
i
<
(
length
+
31
)
/
32
;
i
++
)
data_htobe32
[
i
]
=
htobe32
(
*
(
pData
+
i
));
uint32_t
*
pData_htobe32
=
data_htobe32
;
std
::
vector
<
uint32_t
>
data_htobe32
(
length
/
32
+
1
);
for
(
uint32_t
j
=
0
;
j
<
(
length
+
31
)
/
32
;
j
++
)
data_htobe32
[
j
]
=
htobe32
(
*
(
pData
+
j
));
T
=
0
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
if
(
GetBit
(
pData_htobe32
,
i
))
if
(
GetBit
(
data_htobe32
.
data
()
,
i
))
T
^=
GetWord
(
z
,
i
);
}
...
...
@@ -112,8 +112,8 @@ void EEA3(const uint8_t *pKey, uint32_t count, uint32_t bearer, uint32_t directi
ZUC
(
pKey
,
iv
,
z
,
L
);
for
(
i
=
0
;
i
<
L
;
i
++
)
pData
[
i
]
=
be32toh
(
htobe32
(
*
(
pData
+
i
))
^
z
[
i
]);
pData
[
i
]
=
be32toh
(
htobe32
(
*
(
pData
+
i
))
^
z
[
i
]);
delete
[]
z
;
}
}
// namespace crypt::eea3
}
// namespace crypt
o
::eea3
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