Random module implementation file. More...
#include "random.h"
#include "mcl/mcl_random.h"
#include "memory.h"
#include "security.h"
#include "definitions.h"
#include "log_util.h"
Go to the source code of this file.
Data Structures | |
union | guid_t |
Macros | |
#define | GUID_LENGTH 36 |
Functions | |
E_MCL_ERROR_CODE | mcl_random_generate_guid (char **guid) |
Generates globally unique identifier. More... | |
E_MCL_ERROR_CODE | random_generate_number (mcl_uint32_t *random_number) |
Generates random integer number. More... | |
mcl_uint8_t * | random_generate_array (mcl_size_t size) |
Generates an array of random numbers. More... | |
E_MCL_ERROR_CODE | random_generate_guid (string_t **guid) |
Generates random guid. More... | |
Random module implementation file.
Definition in file random.c.
#define GUID_LENGTH 36 |
Definition at line 25 of file random.c.
Referenced by random_generate_guid().
E_MCL_ERROR_CODE mcl_random_generate_guid | ( | char ** | guid | ) |
Generates globally unique identifier.
[out] | guid | Random guid. |
Definition at line 42 of file random.c.
References ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, MCL_FREE, MCL_NULL, MCL_OK, and random_generate_guid().
mcl_uint8_t* random_generate_array | ( | mcl_size_t | size | ) |
Generates an array of random numbers.
Generates an array in given size
and fills with random numbers.
[in] | size | The size of the array to be created. |
Definition at line 71 of file random.c.
References ASSERT_MESSAGE, ASSERT_STATEMENT_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, MCL_FREE, MCL_MALLOC, MCL_NULL, MCL_OK, and security_generate_random_bytes().
E_MCL_ERROR_CODE random_generate_guid | ( | string_t ** | guid | ) |
Generates random guid.
[out] | guid | Random guid. |
Definition at line 86 of file random.c.
References ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, guid_t::clk_seq_hi_res, guid_t::clk_seq_low, DEBUG_ENTRY, DEBUG_LEAVE, GUID_LENGTH, MCL_FREE, MCL_MALLOC, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, guid_t::node, guid_t::rnd, security_generate_random_bytes(), string_initialize_dynamic(), string_util_snprintf(), guid_t::time_hi_and_version, guid_t::time_low, and guid_t::time_mid.
Referenced by _initialize_payload(), event_initialize(), mcl_random_generate_guid(), and security_handler_generate_jti().
E_MCL_ERROR_CODE random_generate_number | ( | mcl_uint32_t * | random_number | ) |
Generates random integer number.
[out] | random_number | Pointer to the random number generated. |
Definition at line 61 of file random.c.
References DEBUG_ENTRY, DEBUG_LEAVE, and security_generate_random_bytes().
Referenced by _generate_random_boundary().