Skip to content

Update of Dilithium and Kyber aarch64#527

Merged
thomwiggers merged 18 commits intoPQClean:masterfrom
vincentvbh:master
Jan 25, 2024
Merged

Update of Dilithium and Kyber aarch64#527
thomwiggers merged 18 commits intoPQClean:masterfrom
vincentvbh:master

Conversation

@vincentvbh
Copy link
Copy Markdown
Contributor

@vincentvbh vincentvbh commented Nov 20, 2023

Dear all,

This pull request is an update of the aarch64 implementation of Dilithium and Kyber. Below are the summary of the changes.

(i) An improved version of NTT/iNTT exploiting the parallelism of arithmetic and memory ports (the idea was already applied to other simpler functions)
(ii) br lr -> ret, this resolves open-quantum-safe/liboqs#1448.
(iii) Constant declaration at proper .c files and remove unused constants (this resolves #516).
(iv) Clarify the LICENSE file, this resolves #498.
(v) Correct and extend the namespacing, the correction resolves #495.

Related issues that remain: #515.
I need to look into this in the future.

Additionally, I have a question for PQClean: Can I assume that there will be something like fips202x2 for parallelized shake and sha3 on Armv8-A and skip the namespacing for this part?
Currently, I skipped the namespacing for parallelized shake and sha3 since I assumed this.

Thanks,
Vincent

@thomwiggers
Copy link
Copy Markdown
Member

Additionally, I have a question for PQClean: Can I assume that there will be something like fips202x2 for parallelized shake and sha3 on Armv8-A and skip the namespacing for this part?

We probably should extract this...

@vincentvbh
Copy link
Copy Markdown
Contributor Author

Please tell me how to proceed since there will be a new update for the code base because of https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/FMfcgzGwJJWvxLVmcxTTHGgNnPqFsqzp.
I think it is more favorable to catch on this.

@thomwiggers
Copy link
Copy Markdown
Member

Hi, it'd be nice if you could add the addition of the fips202x2 primitive to the common folder in a similar way as the current fips202x4 primitive, as a part of this PR.

@thomwiggers
Copy link
Copy Markdown
Member

I have tried to fix the tests (at least for other schemes) by moving the fips202x2 files in common in their own subfolder: otherwise, they get picked up by CI on non-Aarch64 platforms. I've pushed this to your branch.

@thomwiggers
Copy link
Copy Markdown
Member

  • it seems astyle isn't happy yet (run with e.g. astyle --project crypto_kem/kyber*/aarch64/*.[ch])
  • I still see some fips202x2.c files in Kyber512 and Kyber1024

void KeccakF1600_StatePermutex2(v128 state[25]) {
#if (__APPLE__ && __ARM_FEATURE_CRYPTO) || (__ARM_FEATURE_SHA3) /* although not sure what is being implemented, we find something fast */
PQCLEAN_KYBER512_AARCH64_f1600x2(state, neon_KeccakF_RoundConstants);
f1600x2(state, neon_KeccakF_RoundConstants);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is f1600x2 supposed to come from? This fails to compile on my M2 Mac.

@thomwiggers
Copy link
Copy Markdown
Member

This PR should also be checked if we need to include #533

@thomwiggers thomwiggers merged commit 7ecd650 into PQClean:master Jan 25, 2024
@thomwiggers
Copy link
Copy Markdown
Member

Sorry, I accidentally merged this PR 🤦🏼

Could you recreate it?

@thomwiggers
Copy link
Copy Markdown
Member

I re-created it, you should be able to continue pushing to your fork.

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

Labels

None yet

Projects

None yet

2 participants