Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
27bb59d3
Commit
27bb59d3
authored
8 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
better handling of NETTLE version in CMake
parent
7c6e48d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmake_targets/CMakeLists.txt
+7
-10
7 additions, 10 deletions
cmake_targets/CMakeLists.txt
openair3/TEST/test_aes128_ctr_decrypt.c
+1
-1
1 addition, 1 deletion
openair3/TEST/test_aes128_ctr_decrypt.c
openair3/TEST/test_aes128_ctr_encrypt.c
+1
-1
1 addition, 1 deletion
openair3/TEST/test_aes128_ctr_encrypt.c
with
9 additions
and
12 deletions
cmake_targets/CMakeLists.txt
+
7
−
10
View file @
27bb59d3
...
...
@@ -1538,20 +1538,17 @@ endif()
message
(
"NETTLE VERSION_INSTALLED =
${
NETTLE_VERSION
}
"
)
string
(
REGEX MATCH
"[+-]?[0-9]+([.][0-9]+)?"
nv
${
NETTLE_VERSION
}
)
string
(
REGEX REPLACE
"([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MAJOR
${
NETTLE_VERSION
}
)
string
(
REGEX REPLACE
"[0-9]+
\\
.([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MINOR
${
NETTLE_VERSION
}
)
message
(
"NETTLE_VERSION_MAJOR =
${
NETTLE_VERSION_MAJOR
}
"
)
message
(
"NETTLE_VERSION_MINOR =
${
NETTLE_VERSION_MINOR
}
"
)
# WE only pass the major and first minor in the define and ignore the rest
#message("NETTLE_VERSION USED = ${nv}")
# we need to remove decimal as floating point arithematic does not work properly with C preprocessor
STRING
(
REGEX REPLACE
"[.]"
""
nv
${
nv
}
)
if
(
"
${
nv
}
"
STREQUAL
""
)
if
(
"
${
NETTLE_VERSION_MAJOR
}
"
STREQUAL
""
OR
"
${
NETTLE_VERSION_MINOR
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
set
(
NETTLE_VERSION
"
${
nv
}
"
)
add_definitions
(
"-DNETTLE_VERSION=
${
NETTLE_VERSION
}
"
)
add_definitions
(
"-DNETTLE_VERSION_MAJOR=
${
NETTLE_VERSION_MAJOR
}
"
)
add_definitions
(
"-DNETTLE_VERSION
_MINOR
=
${
NETTLE_VERSION
_MINOR
}
"
)
pkg_search_module
(
XPM xpm
)
if
(
NOT
${
XPM_FOUND
}
)
...
...
This diff is collapsed.
Click to expand it.
openair3/TEST/test_aes128_ctr_decrypt.c
+
1
−
1
View file @
27bb59d3
...
...
@@ -48,7 +48,7 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION
<= 27
#if NETTLE_VERSION
_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
...
...
This diff is collapsed.
Click to expand it.
openair3/TEST/test_aes128_ctr_encrypt.c
+
1
−
1
View file @
27bb59d3
...
...
@@ -47,7 +47,7 @@ static void test_cipher_ctr(const struct nettle_cipher *cipher, const uint8_t *k
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION
<= 27
#if NETTLE_VERSION
_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
...
...
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