WL#3986: Add SHA2 support

Affects: Server-6.0 — Status: Complete — Priority: Medium

We already implement SHA1.  This implements the remaining four fips-approved
Secure Hash Algorithms for computing a condensed digital representation,
SHA-224, SHA-256, SHA-384, and SHA-512, collectively known as "SHA-2".  The
number "224" and such refers to the digest length.

Algorithm specification documents:  
  http://csrc.nist.gov/CryptoToolkit/tkhash.html
  http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf

MySQL SQL function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.
  SHA2( string cleartext, integer hash_length ) 
-> string hash, or NULL

Return a string representation of the hash number in hexadecimal.

hash_length must be one of 224, 256, 384, or 512 (or zero, means => 512). If
it's none of those numbers, then it must return NULL and raise a warning.
See patch for BUG#13174 "Patch: SHA2 function".

You must be logged in to tag this worklog

No Comments yet

Votes

Not yet rated.
You must be logged in to vote.

Watches

0 members are watching this worklog
You must be logged in to track this worklog.

Provide Feedback

Please note:
HTML will be purified, but we allow for a number of HTML tags so that you have the flexibility to decorate your comment text to some extent. The comments allow the following HTML tags:

strong, b, em, blockquote, a, code, pre

To put code into your comment, simply encapsulate your code with
[code language="XXX"][/code], where XXX is any common language, for instance "PHP", "SQL", "C", etc.



You must be logged in to comment