twiss / webcrypto-modern-algos

Proposal for the addition of various modern algorithms to the Web Cryptography API, as well as feature detection for algorithm support
https://twiss.github.io/webcrypto-modern-algos/
3 stars 0 forks source link

CShake Customisation string #4

Closed Frosne closed 2 months ago

Frosne commented 2 months ago

From https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf Section 3.

S is a customization bit string. The user selects this string to define a variant of the function. When no customization is desired, S is set to the empty string.

Should the customization in https://twiss.github.io/webcrypto-modern-algos/#cshake-params be optional? Or, should you specify that if no customization is provided, then the code will use an empty buffer?

Frosne commented 2 months ago

The same probably for functionName?

twiss commented 2 months ago

Hi @Frosne :wave: The customization and functionName parameters are already optional, since there's no required keyword.

I didn't specify what to do when it's absent since I interpreted the text you quoted as saying that they're optional in the underlying spec as well. But, looking at my text again, it is taking the contents of the parameter, which is probably not legal if they're undefined. I'll try to fix that.

But yes, one way or another the intention was to say that if you don't pass them, the empty array buffer / "bit string" ends up being used :)

twiss commented 2 months ago

I've attempted to clarify this in https://github.com/twiss/webcrypto-modern-algos/commit/fdc62a1bef9863d94f5f9122488b39c9ba556a74 :) Thanks for pointing this out!