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

Add support for ML-DSA context #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

johngray-dev
Copy link

  • Added support for the ML-DSA Context
  • Updated version to 1.1
  • Added Tests for testing the context in java.
  • Question: If an algorithm that doesn't support a context calls the API with a context, is it expected to fail, or should the context just be ignored by the libOQS library. I think it should fail because it would be operator error, and they should be alerted to the fact that they are trying to call an algorithm with a context that doesn't support a context.

@johngray-dev
Copy link
Author

johngray-dev commented Dec 10, 2024

When resolved, this closes #27

@SWilson4
Copy link
Member

* Question:  If an algorithm that doesn't support a context calls the API with a context, is it expected to fail, or should the context just be ignored by the libOQS library.   I think it should fail because it would be operator error, and they should be alerted to the fact that they are trying to call an algorithm with a context that doesn't support a context.

liboqs will return an error code unless the provided context / length are NULL / 0. See https://github.com/open-quantum-safe/liboqs/blob/0.12.0/src/sig/mayo/sig_mayo_1.c#L92 for an example.

Copy link
Member

@SWilson4 SWilson4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @johngray-dev! Would you also be able to switch out the tests/examples to use ML-KEM / ML-DSA instead of Kyber / Dilithium? Since this will be a new release, it would be nice for it to work with future versions of liboqs that no longer support the older algorithms.

@@ -1,4 +1,4 @@
liboqs-java version 0.1.0
liboqs-java version 0.1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on making this 0.2.0 instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think since it's a notable API change it's worth bumping to 0.2.0.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I agree.. I will move it to 0.2.0

@@ -69,4 +104,12 @@ private static Stream<String> getEnabledSigsAsStream() {
return enabled_sigs.parallelStream();
}

// /**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this commented code block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added because only ML-DSA can use a context at the moment. I suppose in the future SLH-DSA and others might make use of it, and they would need testing as well.

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

Successfully merging this pull request may close these issues.

LibOQS-Java will need to support passing in the Context String into the Sign API
3 participants