Implement remaining SHA variations for WebCrypto
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Nov 2013 18:19:35 +0000 (18:19 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Nov 2013 18:19:35 +0000 (18:19 +0000)
commitbe66fb84424bb64f16bad52a34b8d393650fd433
tree6a52b7e1ff7562a71477d977cde3808b7a72e3c6
parent359fbfabc188ab4d6649560f7e00bbff0659c246
Implement remaining SHA variations for WebCrypto
https://bugs.webkit.org/show_bug.cgi?id=123659

Reviewed by Anders Carlsson.

Source/WebCore:

Tests: crypto/subtle/sha-224.html
       crypto/subtle/sha-256.html
       crypto/subtle/sha-384.html
       crypto/subtle/sha-512.html

* WebCore.xcodeproj/project.pbxproj:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp: Added.
(WebCore::CryptoAlgorithmSHA224::CryptoAlgorithmSHA224):
(WebCore::CryptoAlgorithmSHA224::~CryptoAlgorithmSHA224):
(WebCore::CryptoAlgorithmSHA224::create):
(WebCore::CryptoAlgorithmSHA224::identifier):
* crypto/algorithms/CryptoAlgorithmSHA224.h: Added.
* crypto/algorithms/CryptoAlgorithmSHA256.cpp: Added.
(WebCore::CryptoAlgorithmSHA256::CryptoAlgorithmSHA256):
(WebCore::CryptoAlgorithmSHA256::~CryptoAlgorithmSHA256):
(WebCore::CryptoAlgorithmSHA256::create):
(WebCore::CryptoAlgorithmSHA256::identifier):
* crypto/algorithms/CryptoAlgorithmSHA256.h: Added.
* crypto/algorithms/CryptoAlgorithmSHA384.cpp: Added.
(WebCore::CryptoAlgorithmSHA384::CryptoAlgorithmSHA384):
(WebCore::CryptoAlgorithmSHA384::~CryptoAlgorithmSHA384):
(WebCore::CryptoAlgorithmSHA384::create):
(WebCore::CryptoAlgorithmSHA384::identifier):
* crypto/algorithms/CryptoAlgorithmSHA384.h: Added.
* crypto/algorithms/CryptoAlgorithmSHA512.cpp: Added.
(WebCore::CryptoAlgorithmSHA512::CryptoAlgorithmSHA512):
(WebCore::CryptoAlgorithmSHA512::~CryptoAlgorithmSHA512):
(WebCore::CryptoAlgorithmSHA512::create):
(WebCore::CryptoAlgorithmSHA512::identifier):
* crypto/algorithms/CryptoAlgorithmSHA512.h: Added.
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/mac/CryptoAlgorithmSHA224Mac.cpp: Added.
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/mac/CryptoAlgorithmSHA256Mac.cpp: Added.
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/mac/CryptoAlgorithmSHA384Mac.cpp: Added.
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/mac/CryptoAlgorithmSHA512Mac.cpp: Added.
(WebCore::CryptoAlgorithmSHA512::digest):

LayoutTests:

* crypto/subtle/sha-224-expected.txt: Added.
* crypto/subtle/sha-224.html: Added.
* crypto/subtle/sha-256-expected.txt: Added.
* crypto/subtle/sha-256.html: Added.
* crypto/subtle/sha-384-expected.txt: Added.
* crypto/subtle/sha-384.html: Added.
* crypto/subtle/sha-512-expected.txt: Added.
* crypto/subtle/sha-512.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/crypto/subtle/sha-224-expected.txt [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-224.html [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-256-expected.txt [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-256.html [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-384-expected.txt [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-384.html [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-512-expected.txt [new file with mode: 0644]
LayoutTests/crypto/subtle/sha-512.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.h [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.h [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.h [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp [new file with mode: 0644]
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.h [new file with mode: 0644]
Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp
Source/WebCore/crypto/mac/CryptoAlgorithmSHA224Mac.cpp [new file with mode: 0644]
Source/WebCore/crypto/mac/CryptoAlgorithmSHA256Mac.cpp [new file with mode: 0644]
Source/WebCore/crypto/mac/CryptoAlgorithmSHA384Mac.cpp [new file with mode: 0644]
Source/WebCore/crypto/mac/CryptoAlgorithmSHA512Mac.cpp [new file with mode: 0644]