Mistake on this page? Email us
pal_plat_drbg.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright 2016, 2017 ARM Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *******************************************************************************/
16 
17 
18 #ifndef _PAL_PLAT_DRBG_H
19 #define _PAL_PLAT_DRBG_H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include "pal.h"
26 
27 
41 
45 
46 // XXX: following two are really easy to mix up, a better naming needs to be done
47 //
48 // * pal_plat_osRandomBuffer_public() - The one which is called by pal_osRandomBuffer(), one which
49 // will block until there is enough entropy harvested
50 //
51 // * pal_plat_osRandomBuffer() - The lower level part, used by pal_plat_osRandomBuffer_public(),
52 // this is nonblocking version which will return as much as possible.
53 // Perhaps this should be pal_plat_GetosRandomBufferFromHW() to align
54 // with logic used with similar purpose function as pal_plat_osGetRoTFromHW().
55 
64 palStatus_t pal_plat_osRandomBuffer(uint8_t *randomBuf, size_t bufSizeBytes, size_t* actualRandomSizeBytes);
65 
75 palStatus_t pal_plat_osRandomBuffer_blocking(uint8_t *randomBuf, size_t bufSizeBytes);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 #endif //_PAL_PLAT_RTOS_H
palStatus_t pal_plat_DRBGInit(void)
Initialize all data structures (semaphores, mutexes, memory pools, message queues) at system initiali...
palStatus_t pal_plat_DRBGDestroy(void)
De-initialize thread objects.
PAL. This file contains the general API to initiate and destroy the PAL component. This is part of the PAL service API.
palStatus_t pal_plat_osRandomBuffer(uint8_t *randomBuf, size_t bufSizeBytes, size_t *actualRandomSizeBytes)
Generate a random number into the given buffer with the given size in bytes.
palStatus_t pal_plat_osRandomBuffer_blocking(uint8_t *randomBuf, size_t bufSizeBytes)
Generate random number into given buffer with given size in bytes.
int32_t palStatus_t
Definition: pal_types.h:49