Add a crypto algorithm abstraction
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 17:13:49 +0000 (17:13 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 17:13:49 +0000 (17:13 +0000)
commita8178995dde03a3e59bfbcd061a20181677e6a4e
treec8967f93c0ea5a1f1171e558d8691d3982286ffa
parentd2e0f2bcff0e243f7310cd53e4eb690c745d2c0e
Add a crypto algorithm abstraction
https://bugs.webkit.org/show_bug.cgi?id=123474

Reviewed by Sam Weinig.

This works slightly differently than WebCrypto implies. We have separate classes
for algorithm and its parameters, while WebCrypto puts them in the same dictionary.

* WebCore.xcodeproj/project.pbxproj: Added new files.

* crypto/CryptoAlgorithm.cpp: Added. As most algorithms don't implement most
operations, default implementations just raise an exception.
* crypto/CryptoAlgorithm.h: Added.

* crypto/CryptoAlgorithmParameters.h: Added. Base class for numerous future parameter
dictionaries, such as HmacParams or HmacKeyParams.

* crypto/CryptoAlgorithmRegistry.cpp: Added.
* crypto/CryptoAlgorithmRegistry.h: Added.
The registry decouples universal bindings code from algorithms that may or may not
be implemented on each platform.

* crypto/mac: Added.
* crypto/mac/CryptoAlgorithmRegistryMac.cpp: Added.
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Algorithms implemented
on Mac will be registered by this function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/crypto/CryptoAlgorithm.cpp [new file with mode: 0644]
Source/WebCore/crypto/CryptoAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/CryptoAlgorithmParameters.h [new file with mode: 0644]
Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp [new file with mode: 0644]
Source/WebCore/crypto/CryptoAlgorithmRegistry.h [new file with mode: 0644]
Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp [new file with mode: 0644]