Changes

Jump to navigation Jump to search
343 bytes added ,  07:24, 31 August 2019
Line 334: Line 334:  
<pre>
 
<pre>
 
     return (smc_get_config(ConfigItem_KernelConfiguration) >> 3) & 1;
 
     return (smc_get_config(ConfigItem_KernelConfiguration) >> 3) & 1;
 +
</pre>
 +
 +
== KernelLdr_GenerateRandomRange ==
 +
 +
This uses entropy from the secure monitor to generate a random value in a range (inclusive).
 +
 +
<pre>
 +
    range_size  = (range_end + 1 - range_start);
 +
    random_value = smc_generate_random_bytes(8);
 +
    random_value -= random_value / range_size * range_size;
 +
    return range_start + random_value;
 
</pre>
 
</pre>
  

Navigation menu