00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved. 00002 * 00003 * The information contained herein is confidential property of Nordic 00004 * Semiconductor ASA.Terms and conditions of usage are described in detail 00005 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 00006 * 00007 * Licensees are granted free, non-transferable use of the information. NO 00008 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from 00009 * the file. 00010 * 00011 * $LastChangedRevision: 133 $ 00012 */ 00013 00019 #include <stdint.h> 00020 #include <stdbool.h> 00021 00022 #include "gzll.h" 00023 #include "gzp.h" 00024 #include "hal_rng.h" 00025 00026 //----------------------------------------------------------------------------- 00027 // MCU specific function implementations 00028 //----------------------------------------------------------------------------- 00029 00030 void gzp_random_numbers_generate(uint8_t* dst, uint8_t n) 00031 { 00032 uint8_t i; 00033 00034 hal_rng_power_up(true); 00035 for(i = 0; i < n; i++) 00036 { 00037 while(!hal_rng_data_ready()) 00038 ; 00039 *(dst++) = hal_rng_read(); 00040 } 00041 hal_rng_power_up(false); 00042 }