Mayank Gupta / Mbed OS pelion-example-frdm

Dependencies:   FXAS21002 FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pal_drbg.c Source File

pal_drbg.c

00001 /*******************************************************************************
00002  * Copyright 2016-2018 ARM Ltd.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *******************************************************************************/
00016 
00017 #include "pal.h"
00018 #include "pal_plat_drbg.h"
00019 
00020 
00021 palStatus_t pal_osRandomBuffer(uint8_t *randomBuf, size_t bufSizeBytes)
00022 {
00023     return pal_plat_osRandomBuffer_blocking(randomBuf, bufSizeBytes);
00024 }
00025 
00026 // a simple wrapper, no need to keep it on platform layer. This uses also direct
00027 // call to pal_plat_osRandomBuffer() in order to let linker to remove as many unused
00028 // as possible.
00029 palStatus_t pal_osRandom32bit(uint32_t *randomInt)
00030 {
00031     palStatus_t status;
00032     status = pal_plat_osRandomBuffer_blocking((uint8_t*)randomInt, sizeof(uint32_t));
00033     return status;
00034 }
00035 
00036