Mailing List Archive

Adding cSHAKE digest
Hello,

In the task T6637, adding cSHAKE and KMAC is proposed. I read the
patch, while it works somehow, it is not easy to merge it directly.

Thus, I do implement cSHAKE part, with minimum change. Attached is my
try.

I plan to take the test vectors for cSHAKE from the patch in T6637 and
add them.
--
Re: Adding cSHAKE digest [ In reply to ]
Hi,

I looked at the cSHAKE changes and wondered whether we should replace
the

struct gcry_cshake_customization
{
const void *n;
unsigned int n_len;
const void *s;
unsigned int s_len;
};

by the already existing

typedef struct
{
size_t size; /* The allocated size of the buffer or 0. */
size_t off; /* Offset into the buffer. */
size_t len; /* The used length of the buffer. */
void *data; /* The buffer. */
} gcry_buffer_t;

Or a new

typedef struct
{
size_t size; /* The allocated size of the buffer or 0. */
size_t off; /* Offset into the buffer. */
size_t len; /* The used length of the buffer. */
const void *data; /* The buffer. */
} gcry_cbuffer_t;

the only disadvantge I see is that it won't be possible to have a sanity
check like

if (buflen != sizeof (struct gcry_cshake_customization))
rc = GPG_ERR_INV_ARG;

But this check could be done if we also define a

typedef struct
{
size_t count;
union {
gcry_buffer_t v[1];
gcry_cbuffer_t c[1];
} io;
} gcry_buffer_desc_t;

Or if one prefers better checks drop the union.

What do you think?


Shalom-Salam,

Werner


--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein