| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 WebCryptoAesGcmParams(WebVector<unsigned char> iv, | 181 WebCryptoAesGcmParams(WebVector<unsigned char> iv, |
| 182 bool hasAdditionalData, | 182 bool hasAdditionalData, |
| 183 WebVector<unsigned char> additionalData, | 183 WebVector<unsigned char> additionalData, |
| 184 bool hasTagLengthBits, | 184 bool hasTagLengthBits, |
| 185 unsigned char tagLengthBits) | 185 unsigned char tagLengthBits) |
| 186 : m_iv(std::move(iv)), | 186 : m_iv(std::move(iv)), |
| 187 m_hasAdditionalData(hasAdditionalData), | 187 m_hasAdditionalData(hasAdditionalData), |
| 188 m_optionalAdditionalData(std::move(additionalData)), | 188 m_optionalAdditionalData(std::move(additionalData)), |
| 189 m_hasTagLengthBits(hasTagLengthBits), | 189 m_hasTagLengthBits(hasTagLengthBits), |
| 190 m_optionalTagLengthBits(tagLengthBits) { | 190 m_optionalTagLengthBits(tagLengthBits) { |
| 191 DCHECK(hasAdditionalData || m_optionalAdditionalData.isEmpty()); | 191 DCHECK(hasAdditionalData || m_optionalAdditionalData.empty()); |
| 192 DCHECK(hasTagLengthBits || !tagLengthBits); | 192 DCHECK(hasTagLengthBits || !tagLengthBits); |
| 193 } | 193 } |
| 194 | 194 |
| 195 virtual WebCryptoAlgorithmParamsType type() const { | 195 virtual WebCryptoAlgorithmParamsType type() const { |
| 196 return WebCryptoAlgorithmParamsTypeAesGcmParams; | 196 return WebCryptoAlgorithmParamsTypeAesGcmParams; |
| 197 } | 197 } |
| 198 | 198 |
| 199 const WebVector<unsigned char>& iv() const { return m_iv; } | 199 const WebVector<unsigned char>& iv() const { return m_iv; } |
| 200 | 200 |
| 201 bool hasAdditionalData() const { return m_hasAdditionalData; } | 201 bool hasAdditionalData() const { return m_hasAdditionalData; } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 private: | 263 private: |
| 264 const unsigned m_modulusLengthBits; | 264 const unsigned m_modulusLengthBits; |
| 265 const WebVector<unsigned char> m_publicExponent; | 265 const WebVector<unsigned char> m_publicExponent; |
| 266 const WebCryptoAlgorithm m_hash; | 266 const WebCryptoAlgorithm m_hash; |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 class WebCryptoRsaOaepParams : public WebCryptoAlgorithmParams { | 269 class WebCryptoRsaOaepParams : public WebCryptoAlgorithmParams { |
| 270 public: | 270 public: |
| 271 WebCryptoRsaOaepParams(bool hasLabel, WebVector<unsigned char> label) | 271 WebCryptoRsaOaepParams(bool hasLabel, WebVector<unsigned char> label) |
| 272 : m_hasLabel(hasLabel), m_optionalLabel(std::move(label)) { | 272 : m_hasLabel(hasLabel), m_optionalLabel(std::move(label)) { |
| 273 DCHECK(hasLabel || m_optionalLabel.isEmpty()); | 273 DCHECK(hasLabel || m_optionalLabel.empty()); |
| 274 } | 274 } |
| 275 | 275 |
| 276 virtual WebCryptoAlgorithmParamsType type() const { | 276 virtual WebCryptoAlgorithmParamsType type() const { |
| 277 return WebCryptoAlgorithmParamsTypeRsaOaepParams; | 277 return WebCryptoAlgorithmParamsTypeRsaOaepParams; |
| 278 } | 278 } |
| 279 | 279 |
| 280 bool hasLabel() const { return m_hasLabel; } | 280 bool hasLabel() const { return m_hasLabel; } |
| 281 const WebVector<unsigned char>& optionalLabel() const { | 281 const WebVector<unsigned char>& optionalLabel() const { |
| 282 return m_optionalLabel; | 282 return m_optionalLabel; |
| 283 } | 283 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 unsigned iterations() const { return m_iterations; } | 411 unsigned iterations() const { return m_iterations; } |
| 412 | 412 |
| 413 private: | 413 private: |
| 414 const WebVector<unsigned char> m_salt; | 414 const WebVector<unsigned char> m_salt; |
| 415 const unsigned m_iterations; | 415 const unsigned m_iterations; |
| 416 }; | 416 }; |
| 417 | 417 |
| 418 } // namespace blink | 418 } // namespace blink |
| 419 | 419 |
| 420 #endif | 420 #endif |
| OLD | NEW |