Skip to content

Hardware-Accelerator Crypto #41

@maxgerhardt

Description

@maxgerhardt

On the Uno R4 WiFi, I'd like to make use of the Renesas' chips SCE (Secure Cryptography Engine). According to the .h file, the chip does that peripheral.

#define BSP_FEATURE_BSP_HAS_SCE5 (1)
#define BSP_FEATURE_CRYPTO_HAS_SCE5B (0)
#define BSP_FEATURE_CRYPTO_HAS_SCE5 (1)

In docs:
grafik

And r_sce_if.h seems to be the main header that declares the availble functions.

Creating a new .c file and writing a small test program

#include <r_sce_if.h>

void test() {
    const char* msg = "Hello";
    sce_sha_md5_handle_t ctx;
    uint8_t sha256_out[256 / 8];
    uint32_t digestLen = 256/8;
    HW_SCE_McuSpecificInit();
    HW_SCE_Sha256Init(&ctx);
    HW_SCE_Sha256Update(&ctx, (uint8_t*)msg, strlen(msg));
    HW_SCE_Sha256Final(&ctx, sha256_out, &digestLen);

    printf("Hash: ");
    for(int i=0; i < 256/8; i++) printf("%02x", sha256_out[i]);
    printf("\n");
}

fails at the linking stage with

main.c:(.text.test+0xe): undefined reference to `HW_SCE_Sha256Init'
main.c:(.text.test+0x20): undefined reference to `HW_SCE_Sha256Update'
main.c:(.text.test+0x2a): undefined reference to `HW_SCE_Sha256Final'

Some related datasheets very unhelpfully say

grafik

And the implementation of HW_SCE_Sha256Init() and related is nowhere to be found in the FSP (neither v4.0 that you used for this core nor the current version).

Am I blind or do I have to sign a freaking NDA with Renesas to use the crypto accelerator hardware in a chip I already paid money for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions