Skip to content

add 128-EIA2 unit test using 33.401 Annex C.2 vectors - #1529

Open
Noahs212 wants to merge 1 commit into
srsran:masterfrom
Noahs212:add-test-eia2
Open

add 128-EIA2 unit test using 33.401 Annex C.2 vectors#1529
Noahs212 wants to merge 1 commit into
srsran:masterfrom
Noahs212:add-test-eia2

Conversation

@Noahs212

Copy link
Copy Markdown

Noticed there's no unit test for srsran::security_128_eia2() even though
EIA1 and EIA3 both have one in lib/test/common/. EIA2 currently only
gets exercised through the PDCP integration tests, which can't really
catch an algorithm regression — encrypt+decrypt with the same broken
algorithm just cancels out.

Adds the three byte-aligned test vectors from 3GPP TS 33.401 v15.6.0
Annex C.2 (sets 2, 5, 8). Sets 5 and 8 happen to share inputs with
test_eia1.cc's test_set_4 / test_set_7, which is convenient —
it's the same crossover pattern the spec uses across EIA1/EIA2/EIA3.
Sets 1, 3, 4, 6 and 7 have non-byte-aligned message lengths and can't
go through the byte-length wrapper API.

Tested with make test_eia2 && ctest -R test_eia2 and confirmed the
test actually fails when an expected MAC byte is mutated.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants