mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 09:30:49 +02:00
more pr fixes
This commit is contained in:
@@ -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 */
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user