lx_emul: cleanup naming of lx_emul_random_gen*

Issue #4544
This commit is contained in:
Christian Helmuth 2022-07-11 15:18:35 +02:00
parent 1fbe72b7dd
commit 924e1d741d
5 changed files with 16 additions and 16 deletions

View File

@ -32,7 +32,7 @@ void __icmp_send(struct sk_buff * skb_in,int type,int code,__be32 info,const str
void get_random_bytes(void * buf,int nbytes)
{
lx_emul_gen_random_bytes(buf, nbytes);
lx_emul_random_gen_bytes(buf, nbytes);
}
@ -49,7 +49,7 @@ int wait_for_random_bytes(void)
u32 get_random_u32(void)
{
return lx_emul_gen_random_u32();
return lx_emul_random_gen_u32();
}
@ -57,7 +57,7 @@ u32 get_random_u32(void)
u32 prandom_u32(void)
{
return lx_emul_gen_random_u32();
return lx_emul_random_gen_u32();
}
@ -65,7 +65,7 @@ u32 prandom_u32(void)
int __must_check get_random_bytes_arch(void * buf, int nbytes)
{
lx_emul_gen_random_bytes(buf, nbytes);
lx_emul_random_gen_bytes(buf, nbytes);
return nbytes;
}

View File

@ -37,14 +37,14 @@ extern "C" {
* Write a certain number of consecutive, random byte values beginning at
* a given address.
*/
void lx_emul_gen_random_bytes(void *dst,
void lx_emul_random_gen_bytes(void *dst,
unsigned long nr_of_bytes);
/**
* Return a random unsigned integer value.
*/
genode_uint32_t lx_emul_gen_random_u32(void);
genode_uint64_t lx_emul_gen_random_u64(void);
genode_uint32_t lx_emul_random_gen_u32(void);
genode_uint64_t lx_emul_random_gen_u64(void);
#ifdef __cplusplus
}

View File

@ -190,12 +190,12 @@ static Xoroshiro_128_plus_reseeding &xoroshiro()
}
void lx_emul_gen_random_bytes(void *dst,
void lx_emul_random_gen_bytes(void *dst,
unsigned long nr_of_bytes)
{
/* validate arguments */
if (dst == nullptr || nr_of_bytes == 0) {
error("lx_emul_gen_random_bytes called with invalid args!");
error(__func__, " called with invalid args!");
return;
}
/* fill up the destination with random 64-bit values as far as possible */
@ -217,13 +217,13 @@ void lx_emul_gen_random_bytes(void *dst,
}
genode_uint32_t lx_emul_gen_random_u32()
genode_uint32_t lx_emul_random_gen_u32()
{
return (genode_uint32_t)xoroshiro().get_u64();
}
genode_uint64_t lx_emul_gen_random_u64()
genode_uint64_t lx_emul_random_gen_u64()
{
return (genode_uint64_t)xoroshiro().get_u64();
}

View File

@ -26,13 +26,13 @@ void add_input_randomness(unsigned int type,unsigned int code,unsigned int value
u32 get_random_u32(void)
{
return lx_emul_gen_random_u32();
return lx_emul_random_gen_u32();
}
u64 get_random_u64(void)
{
return lx_emul_gen_random_u64();
return lx_emul_random_gen_u64();
}
@ -41,7 +41,7 @@ int __must_check get_random_bytes_arch(void *buf, int nbytes)
if (nbytes < 0)
return -1;
lx_emul_gen_random_bytes(buf, nbytes);
lx_emul_random_gen_bytes(buf, nbytes);
return nbytes;
}

View File

@ -459,13 +459,13 @@ void __put_page(struct page * page)
void prandom_bytes(void *buf, size_t bytes)
{
lx_emul_gen_random_bytes(buf, bytes);
lx_emul_random_gen_bytes(buf, bytes);
}
u32 prandom_u32(void)
{
return lx_emul_gen_random_u32();
return lx_emul_random_gen_u32();
}