| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 WebCryptoAlgorithmParamsTypeEcdhKeyDeriveParams, // DeriveBits | 238 WebCryptoAlgorithmParamsTypeEcdhKeyDeriveParams, // DeriveBits |
| 239 WebCryptoAlgorithmParamsTypeNone, // WrapKey | 239 WebCryptoAlgorithmParamsTypeNone, // WrapKey |
| 240 WebCryptoAlgorithmParamsTypeNone // UnwrapKey | 240 WebCryptoAlgorithmParamsTypeNone // UnwrapKey |
| 241 } | 241 } |
| 242 }, | 242 }, |
| 243 }; | 243 }; |
| 244 | 244 |
| 245 // Initializing the algorithmIdToInfo table above depends on knowing the enum | 245 // Initializing the algorithmIdToInfo table above depends on knowing the enum |
| 246 // values for algorithm IDs. If those ever change, the table will need to be | 246 // values for algorithm IDs. If those ever change, the table will need to be |
| 247 // updated. | 247 // updated. |
| 248 COMPILE_ASSERT(WebCryptoAlgorithmIdAesCbc == 0, AesCbc_idDoesntMatch); | 248 static_assert(WebCryptoAlgorithmIdAesCbc == 0, "AES CBC id must match"); |
| 249 COMPILE_ASSERT(WebCryptoAlgorithmIdHmac == 1, Hmac_idDoesntMatch); | 249 static_assert(WebCryptoAlgorithmIdHmac == 1, "HMAC id must match"); |
| 250 COMPILE_ASSERT(WebCryptoAlgorithmIdRsaSsaPkcs1v1_5 == 2, RsaSsaPkcs1v1_5_idDoesn
tMatch); | 250 static_assert(WebCryptoAlgorithmIdRsaSsaPkcs1v1_5 == 2, "RSASSA-PKCS1-v1_5 id mu
st match"); |
| 251 COMPILE_ASSERT(WebCryptoAlgorithmIdSha1 == 3, Sha1_idDoesntMatch); | 251 static_assert(WebCryptoAlgorithmIdSha1 == 3, "SHA1 id must match"); |
| 252 COMPILE_ASSERT(WebCryptoAlgorithmIdSha256 == 4, Sha256_idDoesntMatch); | 252 static_assert(WebCryptoAlgorithmIdSha256 == 4, "SHA256 id must match"); |
| 253 COMPILE_ASSERT(WebCryptoAlgorithmIdSha384 == 5, Sha384_idDoesntMatch); | 253 static_assert(WebCryptoAlgorithmIdSha384 == 5, "SHA384 id must match"); |
| 254 COMPILE_ASSERT(WebCryptoAlgorithmIdSha512 == 6, Sha512_idDoesntMatch); | 254 static_assert(WebCryptoAlgorithmIdSha512 == 6, "SHA512 id must match"); |
| 255 COMPILE_ASSERT(WebCryptoAlgorithmIdAesGcm == 7, AesGcm_idDoesntMatch); | 255 static_assert(WebCryptoAlgorithmIdAesGcm == 7, "AES GCM id must match"); |
| 256 COMPILE_ASSERT(WebCryptoAlgorithmIdRsaOaep == 8, RsaOaep_idDoesntMatch); | 256 static_assert(WebCryptoAlgorithmIdRsaOaep == 8, "RSA OAEP id must match"); |
| 257 COMPILE_ASSERT(WebCryptoAlgorithmIdAesCtr == 9, AesCtr_idDoesntMatch); | 257 static_assert(WebCryptoAlgorithmIdAesCtr == 9, "AES CTR id must match"); |
| 258 COMPILE_ASSERT(WebCryptoAlgorithmIdAesKw == 10, AesKw_idDoesntMatch); | 258 static_assert(WebCryptoAlgorithmIdAesKw == 10, "AESKW id must match"); |
| 259 COMPILE_ASSERT(WebCryptoAlgorithmIdRsaPss == 11, RsaPss_idDoesntMatch); | 259 static_assert(WebCryptoAlgorithmIdRsaPss == 11, "RSA-PSS id must match"); |
| 260 COMPILE_ASSERT(WebCryptoAlgorithmIdEcdsa == 12, Ecdsa_idDoesntMatch); | 260 static_assert(WebCryptoAlgorithmIdEcdsa == 12, "ECDSA id must match"); |
| 261 COMPILE_ASSERT(WebCryptoAlgorithmIdEcdh == 13, Ecdh_idDoesntMatch); | 261 static_assert(WebCryptoAlgorithmIdEcdh == 13, "ECDH id must match"); |
| 262 COMPILE_ASSERT(WebCryptoAlgorithmIdLast == 13, Last_idDoesntMatch); | 262 static_assert(WebCryptoAlgorithmIdLast == 13, "last id must match"); |
| 263 COMPILE_ASSERT(10 == WebCryptoOperationLast, UpdateParamsMapping); | 263 static_assert(10 == WebCryptoOperationLast, "the parameter mapping needs to be u
pdated"); |
| 264 | 264 |
| 265 } // namespace | 265 } // namespace |
| 266 | 266 |
| 267 class WebCryptoAlgorithmPrivate : public ThreadSafeRefCounted<WebCryptoAlgorithm
Private> { | 267 class WebCryptoAlgorithmPrivate : public ThreadSafeRefCounted<WebCryptoAlgorithm
Private> { |
| 268 public: | 268 public: |
| 269 WebCryptoAlgorithmPrivate(WebCryptoAlgorithmId id, PassOwnPtr<WebCryptoAlgor
ithmParams> params) | 269 WebCryptoAlgorithmPrivate(WebCryptoAlgorithmId id, PassOwnPtr<WebCryptoAlgor
ithmParams> params) |
| 270 : id(id) | 270 : id(id) |
| 271 , params(params) | 271 , params(params) |
| 272 { | 272 { |
| 273 } | 273 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 { | 464 { |
| 465 m_private = other.m_private; | 465 m_private = other.m_private; |
| 466 } | 466 } |
| 467 | 467 |
| 468 void WebCryptoAlgorithm::reset() | 468 void WebCryptoAlgorithm::reset() |
| 469 { | 469 { |
| 470 m_private.reset(); | 470 m_private.reset(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |