Re: [PATCH v2] KEYS: add SP800-56A KDF support for DH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Freitag, 5. August 2016, 09:08:59 CEST schrieb Mat Martineau:

Hi Mat,

> > 
> > When trying to implement it, I think that it would even be more confusing,
> > because we need a conditional in any case. Do you like
> > 
> > return __keyctl_dh_compute(params, buffer, buflen, (kdf) ? &kdfcopy :
> > NULL);
> > 
> > better than the already presented code? Besides, this would now imply that
> > we have two conditionals instead of one.
> 
> Another approach that uses one conditional is to add a struct
> keyctl_kdf_params* variable and assign it in the conditional block. Maybe
> that's not much of a win, it's up to you.

To be honest, I like the code as is, because although you have two 
invocations, it is yet just a few lines in size and thus readable and second 
either my suggestion or yours with the additional variable implies one or more 
additional instructions (yes, I know, this should not matter too much, but 
still ... ).

Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux