Commit 872bd787 authored by Cedric Roux's avatar Cedric Roux

for the CI to run with a faster snow3g implementation

should be better, is not on my setup, let's see what ci says
(don't review this, this is for testing, will be removed/reworked)
parent 5bb017f2
......@@ -1245,6 +1245,7 @@ set(NR_PDCP_SRC
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_security_nea1.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_integrity_nia2.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/snow3g.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/asn1_utils.c
openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c
openair2/LAYER2/nr_pdcp/cuup_cucp_if.c
......
......@@ -300,6 +300,8 @@ static int nr_pdcp_entity_process_sdu(nr_pdcp_entity_t *entity,
entity->stats.txpdu_bytes += header_size + size + integrity_size;
entity->stats.txpdu_sn = sn;
//usleep(100);
return header_size + size + integrity_size;
}
......
......@@ -28,6 +28,8 @@
#include "openair3/SECU/secu_defs.h"
#include "openair3/SECU/key_nas_deriver.h"
#include "snow3g.h"
stream_security_context_t *nr_pdcp_integrity_nia1_init(unsigned char *integrity_key)
{
nas_stream_cipher_t *ret;
......@@ -46,6 +48,9 @@ void nr_pdcp_integrity_nia1_integrity(stream_security_context_t *integrity_conte
{
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)integrity_context;
snow3g_integrity(count, bearer - 1, direction, (uint8_t *)ctx->context, length, buffer, out);
return;
ctx->message = buffer;
ctx->count = count;
ctx->bearer = bearer-1;
......
......@@ -26,6 +26,8 @@
#include "assertions.h"
#include "snow3g.h"
stream_security_context_t *nr_pdcp_security_nea1_init(unsigned char *ciphering_key)
{
nas_stream_cipher_t *ret;
......@@ -48,6 +50,9 @@ void nr_pdcp_security_nea1_cipher(stream_security_context_t *security_context,
{
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)security_context;
snow3g_ciphering(count, bearer - 1, direction, (uint8_t *)ctx->context, length, buffer, buffer);
return;
ctx->message = buffer;
ctx->count = count;
ctx->bearer = bearer - 1;
......
This diff is collapsed.
#ifndef _SNOW3G_H_
#define _SNOW3G_H_
#include <stdint.h>
typedef struct {
uint32_t s[16];
uint32_t r1, r2, r3;
uint32_t zt;
int zt_size;
} snow3g_t;
void snow3g_init(snow3g_t *s, char *k, char *iv);
uint8_t snow3g_get_next_keystream_byte(snow3g_t *s);
void snow3g_ciphering(uint32_t count, int bearer, int direction, uint8_t *key, int length, uint8_t *in, uint8_t *out);
void snow3g_integrity(uint32_t count, int bearer, int direction, uint8_t *key, int length, uint8_t *in, uint8_t *out);
#endif /* _SNOW3G_H_ */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment