Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespacing FIPS-202 functions #754

Open
hanno-becker opened this issue Feb 6, 2025 · 3 comments
Open

Namespacing FIPS-202 functions #754

hanno-becker opened this issue Feb 6, 2025 · 3 comments

Comments

@hanno-becker
Copy link
Contributor

hanno-becker commented Feb 6, 2025

Currently, the FIPS-202 API has a fairly standard naming, shake128_absorb_once, shake128_squeezeblocks, shake128_init, shake128_release, shake256, sha3_256, sha3_512. If an external FIPS-202 implementation is to be used, this can be convenient if there already happen to exist functions of the required name and semantics in the external implementation. But, if they exist and have a different semantics, then it's an issue (note that one cannot assume any isolation here since some libraries like AWS-LC use single-compilation-unit builds).

I am thus considering to namespace the FIPS-202 API (perhaps even all functions in this repository -- but this is TBD) by mlk_*, to avoid this issue.

This means one will always need some wrapper defining (as a function or at least macro) mlk_shake_.... For example, the libOQS integration will need this to bind the mlk_xxx API to the fips202.h glue code.

@hanno-becker
Copy link
Contributor Author

@bhess What are your thoughts here?

@bhess
Copy link
Contributor

bhess commented Feb 6, 2025

Hi @hanno-becker,

Would it be possible to add an option to optionally enable or disable namespacing for these functions?

@hanno-becker
Copy link
Contributor Author

Hm, I don't see how one could do this -- it's about the name before macro-namespacing. But I might miss something.

For LibOQS, I think all we'd need is a bunch of #define mlk_FOO FOO -- or potentially a static inline wrapper. This would be separate from your fixed glue code. If it helps, we could have this wrapper inside this repository, under integration/oqs. Would that be a possibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants