RTEMS | cpukit/libcrypt: Add SHA3-512 Keccak Implementation (!687)
Gedare Bloom (@gedare)
gitlab at rtems.org
Thu Sep 4 20:41:42 UTC 2025
Gedare Bloom started a new discussion on cpukit/include/crypt.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130012
> +/* Code to re-introduce the C11 memset_s function
> +* which is missing from the RTEMS C11 compiler but which
> +* is used in the libcrypt functions to securely erase
> +* sensitive data after use. Since the C11 memset_s
> +* function is not available we provide our own implementation
> +* here. Should the RTEMS C library ever provide
> +* a conforming memset_s function this code can be removed.
> +*/
> +static inline void memset_s_rtems(void *s, size_t n) {
> + volatile unsigned char *p = (volatile unsigned char *)s;
> + while (n--) {
> + *p++ = 0;
> + }
> +}
> +
> +static inline void explicit_bzero_rtems (void *s, size_t len)
since these 3 functions are only used conditionally on the libc version, you could define them only for the given stdc_version. In addition, you could collapse them to a macro. This would simplify the other parts.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130012
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250904/33f1a137/attachment-0001.htm>
More information about the bugs
mailing list