Commit 95205212 authored by Robert Schmidt's avatar Robert Schmidt

Avoid ubsan error

like this:

  /oai-ran/openair3/SECU/snow3g.c:429:23: runtime error: left shift of 232 by 24 places cannot be represented in type 'int'
parent 523d8463
......@@ -417,14 +417,14 @@ static uint32_t DIVa(int c)
static void lfsr_init(snow3g_t *s, uint32_t f)
{
uint8_t s0_0 = (s->s[0] >> 24) & 0xff;
uint8_t s0_1 = (s->s[0] >> 16) & 0xff;
uint8_t s0_2 = (s->s[0] >> 8) & 0xff;
uint8_t s0_3 = s->s[0] & 0xff;
uint8_t s11_0 = (s->s[11] >> 24) & 0xff;
uint8_t s11_1 = (s->s[11] >> 16) & 0xff;
uint8_t s11_2 = (s->s[11] >> 8) & 0xff;
uint8_t s11_3 = s->s[11] & 0xff;
uint32_t s0_0 = (s->s[0] >> 24) & 0xff;
uint32_t s0_1 = (s->s[0] >> 16) & 0xff;
uint32_t s0_2 = (s->s[0] >> 8) & 0xff;
uint32_t s0_3 = s->s[0] & 0xff;
uint32_t s11_0 = (s->s[11] >> 24) & 0xff;
uint32_t s11_1 = (s->s[11] >> 16) & 0xff;
uint32_t s11_2 = (s->s[11] >> 8) & 0xff;
uint32_t s11_3 = s->s[11] & 0xff;
uint32_t v0 = (s0_1 << 24)
| (s0_2 << 16)
......@@ -464,14 +464,14 @@ static void lfsr_init(snow3g_t *s, uint32_t f)
static void lfsr_keystream(snow3g_t *s)
{
uint8_t s0_0 = (s->s[0] >> 24) & 0xff;
uint8_t s0_1 = (s->s[0] >> 16) & 0xff;
uint8_t s0_2 = (s->s[0] >> 8) & 0xff;
uint8_t s0_3 = s->s[0] & 0xff;
uint8_t s11_0 = (s->s[11] >> 24) & 0xff;
uint8_t s11_1 = (s->s[11] >> 16) & 0xff;
uint8_t s11_2 = (s->s[11] >> 8) & 0xff;
uint8_t s11_3 = s->s[11] & 0xff;
uint32_t s0_0 = (s->s[0] >> 24) & 0xff;
uint32_t s0_1 = (s->s[0] >> 16) & 0xff;
uint32_t s0_2 = (s->s[0] >> 8) & 0xff;
uint32_t s0_3 = s->s[0] & 0xff;
uint32_t s11_0 = (s->s[11] >> 24) & 0xff;
uint32_t s11_1 = (s->s[11] >> 16) & 0xff;
uint32_t s11_2 = (s->s[11] >> 8) & 0xff;
uint32_t s11_3 = s->s[11] & 0xff;
uint32_t v0 = (s0_1 << 24)
| (s0_2 << 16)
......
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