more pr fixes

This commit is contained in:
Thomas Cook
2026-04-23 04:34:09 -04:00
parent b7b0215070
commit 1e2ab2c7c8
4 changed files with 6 additions and 93 deletions
-53
View File
@@ -1,53 +0,0 @@
/* rng_port.c
*
* Copyright (C) 2006-2026 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_NXP_RNG_1
#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include "fsl_rng.h"
int wc_nxp_rng_init(void)
{
CLOCK_EnableClock(kCLOCK_Rng);
RESET_PeripheralReset(kRNG_RST_SHIFT_RSTn);
RNG_Init(RNG);
return 0;
}
int wc_nxp_rng_get_random_data(byte* output, word32 sz)
{
if (RNG_GetRandomData(RNG, output, sz) != kStatus_Success)
return RNG_FAILURE_E;
return 0;
}
#endif /* WOLFSSL_NXP_RNG_1 */
+6 -5
View File
@@ -169,10 +169,6 @@ This library contains implementation for the random number generator.
#include <wolfssl/wolfcrypt/port/psa/psa.h>
#endif
#if defined(WOLFSSL_NXP_RNG_1)
#include "wolfssl/wolfcrypt/port/nxp/rng_port.h"
#endif
#if FIPS_VERSION3_GE(6,0,0)
const unsigned int wolfCrypt_FIPS_drbg_ro_sanity[2] =
{ 0x1a2b3c4d, 0x00000011 };
@@ -3533,6 +3529,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
}
#elif defined(WOLFSSL_NXP_RNG_1)
#include "fsl_rng.h"
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz){
(void)os;
@@ -3540,7 +3537,11 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
if (output == NULL) {
return BUFFER_E;
}
return wc_nxp_rng_get_random_data(output, sz);
if (RNG_GetRandomData(RNG, output, sz) != kStatus_Success)
return RNG_FAILURE_E;
return 0;
}
#elif defined(DOLPHIN_EMULATOR) || defined (WOLFSSL_NDS)
-8
View File
@@ -99,9 +99,6 @@
#include <wolfssl/wolfcrypt/port/nxp/dcp_port.h>
#endif
#ifdef WOLFSSL_NXP_RNG_1
#include <wolfssl/wolfcrypt/port/nxp/rng_port.h>
#endif
#ifdef WOLFSSL_NXP_CASPER
#include <wolfssl/wolfcrypt/port/nxp/casper_port.h>
#endif
@@ -451,11 +448,6 @@ int wolfCrypt_Init(void)
}
#endif
#ifdef WOLFSSL_NXP_RNG_1
if ((ret = wc_nxp_rng_init()) != 0) {
return ret;
}
#endif
#ifdef WOLFSSL_NXP_CASPER
if ((ret = wc_casper_init()) != 0) {
return ret;
-27
View File
@@ -1,27 +0,0 @@
/* rng_port.h
*
* Copyright (C) 2006-2026 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef _RNG_PORT_H_
#define _RNG_PORT_H_
int wc_nxp_rng_init(void);
int wc_nxp_rng_get_random_data(byte* output, word32 sz);
#endif