Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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