RTEMS | cpukit/libcrypt: Add SHA3-512 Keccak Implementation (!687)

Gedare Bloom (@gedare) gitlab at rtems.org
Thu Sep 4 20:52:52 UTC 2025



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687 was reviewed by Gedare Bloom

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-md5.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130013

 >   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 >   * SUCH DAMAGE.
 > - */

this looks wrong.

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-md5.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130014

 >  
 >  #include <sys/cdefs.h>
 > -__FBSDID("$FreeBSD$");

suggest leaving existing code as-is

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha256.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130015

 > - * SHA256-based Unix crypt implementation. Released into the Public Domain by
 > - * Ulrich Drepper <drepper at redhat.com>. */
 > -

should not be removing unless it was taken out of the upstream

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha256.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130016

 > +	/* C11 or newer */
 > +	SHA256_Init(&ctx);
 > +	SHA256_Final(alt_result, &ctx);

no need to repeat these in each block. pull them out to before the first `#if`.

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha3-512.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130017

 > + * SPDX-License-Identifier: BSD-2-Clause
 > + *
 > + * Copyright (c) 2025 RTEMS (http://www.rtems.org/)

There is no such copyright holder.

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha3-512.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130018

 > + *
 > + * Copyright (c) 2025 RTEMS (http://www.rtems.org/)
 > + * Developed (d) 2025 Wayne Michael Thornton (WMT) for RTEMS Project as

Just claim copyright in your name, if you're allowed to do so.

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha3-512.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130019

 > +
 > +    salt_len = strcspn(salt, "$\n");
 > +    if (salt_len > SALT_LEN_MAX) salt_len = SALT_LEN_MAX;

consider refactoring to create a helper function

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt-sha3-512.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130020

 > +        *cp++ = '$';
 > +        --buflen;
 > +    }

ditto

--
  
Gedare Bloom started a new discussion on cpukit/libcrypt/crypt.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687#note_130021

 > +extern struct crypt_format crypt_sha3_512_format;
 > +
 > +__attribute__((constructor))

we don't use this attribute.


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/687
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/b2782b43/attachment-0001.htm>


More information about the bugs mailing list