Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size); | 28 void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size); |
| 29 | 29 |
| 30 // Creates a WebArrayBuffer from a uint8 byte array | 30 // Creates a WebArrayBuffer from a uint8 byte array |
| 31 blink::WebArrayBuffer CreateArrayBuffer(const uint8* data, unsigned data_size); | 31 blink::WebArrayBuffer CreateArrayBuffer(const uint8* data, unsigned data_size); |
| 32 | 32 |
| 33 // This function decodes unpadded 'base64url' encoded data, as described in | 33 // This function decodes unpadded 'base64url' encoded data, as described in |
| 34 // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5. | 34 // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5. |
| 35 // In Web Crypto, this type of encoding is only used inside JWK. | 35 // In Web Crypto, this type of encoding is only used inside JWK. |
| 36 bool Base64DecodeUrlSafe(const std::string& input, std::string* output); | 36 bool Base64DecodeUrlSafe(const std::string& input, std::string* output); |
| 37 | 37 |
| 38 bool IsHashAlgorithm(blink::WebCryptoAlgorithmId alg_id); | |
|
eroman
2014/01/15 23:10:02
This needs to be marked as CONTENT_EXPORT or it wi
padolph
2014/01/16 02:02:04
Done.
| |
| 39 | |
| 38 // Returns the "hash" param for an algorithm if it exists, otherwise returns | 40 // Returns the "hash" param for an algorithm if it exists, otherwise returns |
| 39 // a null algorithm. | 41 // a null algorithm. |
| 40 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( | 42 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( |
| 41 const blink::WebCryptoAlgorithm& algorithm); | 43 const blink::WebCryptoAlgorithm& algorithm); |
| 42 | 44 |
| 43 // Creates a WebCryptoAlgorithm without any parameters. | 45 // Creates a WebCryptoAlgorithm without any parameters. |
| 44 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( | 46 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( |
| 45 blink::WebCryptoAlgorithmId id); | 47 blink::WebCryptoAlgorithmId id); |
| 46 | 48 |
| 47 // Creates an HMAC algorithm whose inner hash algorithm is determined by the | 49 // Creates an HMAC algorithm whose inner hash algorithm is determined by the |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 uint8 tag_length_bytes); | 87 uint8 tag_length_bytes); |
| 86 | 88 |
| 87 // Returns the internal block size for SHA-* | 89 // Returns the internal block size for SHA-* |
| 88 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); | 90 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); |
| 89 | 91 |
| 90 } // namespace webcrypto | 92 } // namespace webcrypto |
| 91 | 93 |
| 92 } // namespace content | 94 } // namespace content |
| 93 | 95 |
| 94 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 96 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| OLD | NEW |