| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // question was unsupported, some parameter combination was unsupported, or | 138 // question was unsupported, some parameter combination was unsupported, or |
| 139 // something has not yet been implemented. | 139 // something has not yet been implemented. |
| 140 static Status ErrorUnsupported(); | 140 static Status ErrorUnsupported(); |
| 141 | 141 |
| 142 // Something unexpected happened in the code, which implies there is a | 142 // Something unexpected happened in the code, which implies there is a |
| 143 // source-level bug. These should not happen, but safer to fail than simply | 143 // source-level bug. These should not happen, but safer to fail than simply |
| 144 // DCHECK. | 144 // DCHECK. |
| 145 static Status ErrorUnexpected(); | 145 static Status ErrorUnexpected(); |
| 146 | 146 |
| 147 // The authentication tag length specified for AES-GCM encrypt/decrypt was | 147 // The authentication tag length specified for AES-GCM encrypt/decrypt was |
| 148 // either greater than 128 bits, or it was not a multiple of 8 bits. | 148 // not 32, 64, 96, 104, 112, 120, or 128. |
| 149 // (zero length is allowed). | |
| 150 static Status ErrorInvalidAesGcmTagLength(); | 149 static Status ErrorInvalidAesGcmTagLength(); |
| 151 | 150 |
| 152 // The "publicExponent" used to generate a key was invalid: either no bytes | 151 // The "publicExponent" used to generate a key was invalid: either no bytes |
| 153 // were specified, or the number was too large to fit into an "unsigned long" | 152 // were specified, or the number was too large to fit into an "unsigned long" |
| 154 // (implemention limitation), or the exponent was zero. | 153 // (implemention limitation), or the exponent was zero. |
| 155 static Status ErrorGenerateKeyPublicExponent(); | 154 static Status ErrorGenerateKeyPublicExponent(); |
| 156 | 155 |
| 157 // The algorithm was null when importing a raw-formatted key. In this case it | 156 // The algorithm was null when importing a raw-formatted key. In this case it |
| 158 // is required. | 157 // is required. |
| 159 static Status ErrorMissingAlgorithmImportRawKey(); | 158 static Status ErrorMissingAlgorithmImportRawKey(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 uint8 tag_length_bytes); | 258 uint8 tag_length_bytes); |
| 260 | 259 |
| 261 // Returns the internal block size for SHA-* | 260 // Returns the internal block size for SHA-* |
| 262 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); | 261 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); |
| 263 | 262 |
| 264 } // namespace webcrypto | 263 } // namespace webcrypto |
| 265 | 264 |
| 266 } // namespace content | 265 } // namespace content |
| 267 | 266 |
| 268 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 267 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| OLD | NEW |