Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Byte order test is incorrect #57

Open

Description

@davidchisnall

This test checks whether __ORDER_BIG_ENDIAN__ is defined at all, but this predefined macro is not intended for that use case. It is identical to the custom IS_BIG_ENDIAN macro in the same file and is expected to be compared against __BYTE_ORDER__.

The current code unconditionally sets the byte order to big endian. The test probably should be:

# if defined(__BYTE_ORDER__)
#  define PLATFORM_BYTE_ORDER __BYTE_ORDER__
# elif defined(__BIG_ENDIAN)
#  define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
# else
#  define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
# endif

Activity

  1. mkannwischer commented on Nov 28, 2025

    @mkannwischer
    Contributor

    Thanks for reporting this.
    mlkem-c-embedded is no longer being maintained/developed.
    You may want to consider https://github.com/pq-code-package/mlkem-native.
    I double checked that the same problem does not exist there.

  2. mkannwischer commented on Nov 28, 2025

    @mkannwischer
    Contributor

    We should probably archive this project to indicate better that it is not under active development anymore.
    I opened #58 to add a disclaimer to the README, and pq-code-package/tsc#191 to consider archiving it

  3. davidchisnall commented on Dec 3, 2025

    @davidchisnall
    Author

    Thanks. I've tried using the other repository. It appears to use around 3x as much stack as this one, which is not ideal for embedded uses (though not the end of the world, the ML-DSA implementation uses four times as much again).

  4. mkannwischer commented on Dec 3, 2025

    @mkannwischer
    Contributor

    Thanks. I've tried using the other repository. It appears to use around 3x as much stack as this one, which is not ideal for embedded uses (though not the end of the world, the ML-DSA implementation uses four times as much again).

    We are actively working on bringing down ML-DSA stack consumption in mldsa-native as we have other consumers also requiring less stack usage (it's quite extreme there indeed).
    For mlkem-native, we could do the same, but we currently do not have any requests to do so. Do you mind opening an issue or sending me an e-mail about your requirements?

  5. davidchisnall commented on Dec 3, 2025

    @davidchisnall
    Author

    Filed pq-code-package/mlkem-native#1338 . I don't have serious requirements yet, I just wanted to get a feel for performance on the cores that we're using in our chips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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