Skip to content

Conversation

@buggywhip
Copy link
Contributor

@buggywhip buggywhip commented Jul 30, 2018

Added single-call crypt functions to each of the stream ciphers using the <cipher>_memory() naming convention.

Checklist

  • documentation is added or updated
  • tests are added or updated

@buggywhip buggywhip requested review from karel-m and sjaeckel July 30, 2018 05:20
Copy link
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

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

LGTM 👍

if ((err = chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1)) != CRYPT_OK) return err;
if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err;
if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1)) return CRYPT_FAIL_TESTVECTOR;
/* crypt in a single call using 64-bit counter with a value of 1 */
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a second testcase that also hits chacha_ivctr32().

fix mixed declarations and code

add _memory chacha_ivctr32() test
@sjaeckel sjaeckel force-pushed the streams-add-single-call-crypt-functions branch from b31130f to 13bc14d Compare September 10, 2018 09:36
@sjaeckel
Copy link
Member

I took the freedom to rebase everything on top of develop and clean up the duplicate commits :)

@sjaeckel sjaeckel force-pushed the streams-add-single-call-crypt-functions branch from 13bc14d to a2b343b Compare September 10, 2018 09:46
@buggywhip
Copy link
Contributor Author

buggywhip commented Sep 10, 2018 via email

Copy link
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

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

I think we should include these xx_memory() implementations in the single c files where there's only a single file for now!
@karel-m what do you think?
@buggywhip sorry, I didn't see that before!

@karel-m
Copy link
Member

karel-m commented Sep 10, 2018

I think we should include these xx_memory() implementations in the single c files where there's only a single file for now!

I am for keeping xx_memory() always in a separate .c file. It has obvious advantages (smaller code) when using static linking.

@sjaeckel
Copy link
Member

Good point I didn't think about!
So let's keep it like that.

@buggywhip buggywhip merged commit b44155f into develop Sep 21, 2018
@sjaeckel sjaeckel deleted the streams-add-single-call-crypt-functions branch October 4, 2018 14:37
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.

4 participants