| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 const WebCryptoRsaHashedKeyGenParams* WebCryptoAlgorithm::rsaHashedKeyGenParams(
) const | 158 const WebCryptoRsaHashedKeyGenParams* WebCryptoAlgorithm::rsaHashedKeyGenParams(
) const |
| 159 { | 159 { |
| 160 ASSERT(!isNull()); | 160 ASSERT(!isNull()); |
| 161 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams) | 161 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams) |
| 162 return static_cast<WebCryptoRsaHashedKeyGenParams*>(m_private->params.ge
t()); | 162 return static_cast<WebCryptoRsaHashedKeyGenParams*>(m_private->params.ge
t()); |
| 163 return 0; | 163 return 0; |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id) |
| 167 { |
| 168 switch (id) { |
| 169 case WebCryptoAlgorithmIdSha1: |
| 170 case WebCryptoAlgorithmIdSha224: |
| 171 case WebCryptoAlgorithmIdSha256: |
| 172 case WebCryptoAlgorithmIdSha384: |
| 173 case WebCryptoAlgorithmIdSha512: |
| 174 return true; |
| 175 case WebCryptoAlgorithmIdAesCbc: |
| 176 case WebCryptoAlgorithmIdHmac: |
| 177 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: |
| 178 case WebCryptoAlgorithmIdRsaEsPkcs1v1_5: |
| 179 case WebCryptoAlgorithmIdAesGcm: |
| 180 case WebCryptoAlgorithmIdRsaOaep: |
| 181 case WebCryptoAlgorithmIdAesCtr: |
| 182 case WebCryptoAlgorithmIdAesKw: |
| 183 break; |
| 184 } |
| 185 return false; |
| 186 } |
| 187 |
| 166 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) | 188 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) |
| 167 { | 189 { |
| 168 m_private = other.m_private; | 190 m_private = other.m_private; |
| 169 } | 191 } |
| 170 | 192 |
| 171 void WebCryptoAlgorithm::reset() | 193 void WebCryptoAlgorithm::reset() |
| 172 { | 194 { |
| 173 m_private.reset(); | 195 m_private.reset(); |
| 174 } | 196 } |
| 175 | 197 |
| 176 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |