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

Cryptographic libraries #144

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Cryptographic libraries #144

wants to merge 10 commits into from

Conversation

y4my4my4m
Copy link
Collaborator

@y4my4my4m y4my4my4m commented Dec 29, 2023

  • AES128 gives the wrong output...but the code seems right
  • ChaCha20 has some weird ASM exception error
  • TweetNaCl simply doesnt pass

Copy link
Contributor

@mknos mknos left a comment

Choose a reason for hiding this comment

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

Maybe the MemCopy() is writing over the ciphertext buffer.

res |= a[0](U32) << 0 * 8;
res |= a[1](U32) << 1 * 8;
res |= a[2](U32) << 2 * 8;
res |= a[3](U32) << 3 * 8;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does promotion to U32 occur after one byte at a[3] is accessed? Considering << is multiplying by a power of 2, why do you need to multiply again by 8?

I64 i;
// Define the plaintext message
U8 plaintext[16] = "Hello, TempleOS!";
U64 plaintext_len = sizeof(plaintext);
Copy link
Contributor

Choose a reason for hiding this comment

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

so 17?

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.

2 participants