random.h File Reference

Random module header file. More...

#include "string_type.h"
Include dependency graph for random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

E_MCL_ERROR_CODE random_generate_number (mcl_uint32_t *random_number)
 Generates random integer number. More...
 
mcl_uint8_trandom_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...
 

Detailed Description

Random module header file.


Date
Aug 15, 2016 Random number generation functions are implemented in this module.

Definition in file random.h.

Function Documentation

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.

Parameters
[in]sizeThe size of the array to be created.
Returns
Returns the generated array of random numbers.

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().

Here is the call graph for this function:

E_MCL_ERROR_CODE random_generate_guid ( string_t **  guid)

Generates random guid.

Parameters
[out]guidRandom guid.
Returns
  • MCL_OK in case of success.
  • MCL_OUT_OF_MEMORY in case there is not enough memory in the system to proceed.
  • MCL_FAIL in case of an internal error in random number generation.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE random_generate_number ( mcl_uint32_t random_number)

Generates random integer number.

Parameters
[out]random_numberPointer to the random number generated.
Returns
  • MCL_OK in case of success.
  • MCL_FAIL in case of an internal error in random number generation.

Definition at line 61 of file random.c.

References DEBUG_ENTRY, DEBUG_LEAVE, and security_generate_random_bytes().

Referenced by _generate_random_boundary().

Here is the call graph for this function:

Here is the caller graph for this function: