Topic: Interest in cryptographic functions within
Author: Thiago Macieira <thiago@macieira.org>
Date: Mon, 10 Feb 2014 15:58:20 -0800
Raw View
Em seg 10 fev 2014, =E0s 17:23:59, Matthew Woehlke escreveu:
> On 2014-02-10 17:07, Markus Mayer wrote:
> > There is still an open question, which I am not sure about:
> > - What is better: sha<512> or sha512?
>=20
> MHO: If you can reasonably implement sha512 like sha_impl(..., 512),
> then sha<512> is good. If the implementation is non-trivially different,
> stick with e.g. sha512.
The SHA2 512-bit implementation is similar to the SHA2 384-bit. The code is=
=20
mostly the same as the SHA2 224 and 256-bit versions, but uses different=20
tables.
If you choose to go with templates, they'll be nothing more than a typedef =
to=20
an existing implementation, or instead they'll be full specialisations.
I also wouldn't go with a number, but with either an enum or a tag structur=
e.=20
Something like:
class enum hash_algorithms {
md4,
md5,
sha1,
sha2_224,
sha2_256,
sha2_384,
sha2_512,
sha3_224,
sha3_256,
sha3_384,
sha3_512
};
template <hash_algorithms _Algo> struct cryptographic_hash;
> Note also you may want to use sha2_512 instead :-).
See above. There's no SHA-1 512. Only SHA-2 and SHA-3 can produce 512-bit=
=20
hashes.
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Markus Mayer <lotharlutz@gmx.de>
Date: Tue, 11 Feb 2014 21:44:36 +0100
Raw View
On 02/11/2014 12:58 AM, Thiago Macieira wrote:
> Em seg 10 fev 2014, =E0s 17:23:59, Matthew Woehlke escreveu:
>> On 2014-02-10 17:07, Markus Mayer wrote:
>>> There is still an open question, which I am not sure about:
>>> - What is better: sha<512> or sha512?
>>
>> MHO: If you can reasonably implement sha512 like sha_impl(..., 512),
>> then sha<512> is good. If the implementation is non-trivially different,
>> stick with e.g. sha512.
>
> The SHA2 512-bit implementation is similar to the SHA2 384-bit. The code =
is
> mostly the same as the SHA2 224 and 256-bit versions, but uses different
> tables.
>
> If you choose to go with templates, they'll be nothing more than a typede=
f to
> an existing implementation, or instead they'll be full specialisations.
>
> I also wouldn't go with a number, but with either an enum or a tag struct=
ure.
> Something like:
>
> class enum hash_algorithms {
> md4,
> md5,
> sha1,
> sha2_224,
> sha2_256,
> sha2_384,
> sha2_512,
> sha3_224,
> sha3_256,
> sha3_384,
> sha3_512
> };
> template <hash_algorithms _Algo> struct cryptographic_hash;
>
What would be the benefits of using an enum or tag structure?
>> Note also you may want to use sha2_512 instead :-).
>
> See above. There's no SHA-1 512. Only SHA-2 and SHA-3 can produce 512-bit
> hashes.
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.