mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00

The codebase was using non-standard headers. It is needed to replace them by the correct ones so that we can use the new libc headers. Change-Id: I530f71d9510cb036e69fe79823c8230afe890b9d Acked-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
27 lines
554 B
C
27 lines
554 B
C
/*
|
|
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <utils.h>
|
|
|
|
#include "rpi3_private.h"
|
|
|
|
/* Get 128 bits of entropy and fuse the values together to form the canary. */
|
|
#define TRNG_NBYTES 16U
|
|
|
|
u_register_t plat_get_stack_protector_canary(void)
|
|
{
|
|
size_t i;
|
|
u_register_t buf[TRNG_NBYTES / sizeof(u_register_t)];
|
|
u_register_t ret = 0U;
|
|
|
|
rpi3_rng_read(buf, sizeof(buf));
|
|
|
|
for (i = 0U; i < ARRAY_SIZE(buf); i++)
|
|
ret ^= buf[i];
|
|
|
|
return ret;
|
|
}
|