Chromium Code Reviews| Index: content/renderer/webcrypto/webcrypto_util.h |
| diff --git a/content/renderer/webcrypto/webcrypto_util.h b/content/renderer/webcrypto/webcrypto_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ae80d34a1cbb09dbd68ad66fe04068c5304ae21 |
| --- /dev/null |
| +++ b/content/renderer/webcrypto/webcrypto_util.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTI_H_ |
|
eroman
2013/10/28 23:02:00
typo I presume: UTI --> UTIL
padolph
2013/10/29 02:25:40
Done.
|
| +#define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTI_H_ |
| + |
| +#include <map> |
| +#include <string> |
| +#include <vector> |
| +#include "base/basictypes.h" |
| +#include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
| +#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
| + |
| +namespace content { |
|
eroman
2013/10/28 23:02:00
I'm not entirely sure on whether we should put thi
|
| + |
| +const uint8* Start(const std::vector<uint8>& data); |
|
eroman
2013/10/28 23:02:00
I'm not sure how I feel about this being in the he
padolph
2013/10/29 02:25:40
I would like to remove this altogether, because I'
eroman
2013/10/29 03:03:46
The reason for Start() was to avoid doing &vec[0]
|
| + |
| +void ShrinkBuffer(WebKit::WebArrayBuffer* buffer, unsigned new_size); |
| + |
| +bool Base64DecodeUrlSafe(const std::string& input, std::string* output); |
|
eroman
2013/10/28 23:02:00
Please move the function-level comments from the .
padolph
2013/10/29 02:25:40
Done.
|
| + |
| +WebKit::WebCryptoAlgorithm CreateAlgorithm(WebKit::WebCryptoAlgorithmId id); |
| + |
| +WebKit::WebCryptoAlgorithm CreateHmacAlgorithmByKeyLen( |
| + unsigned short hash_key_length); |
| + |
| +WebKit::WebCryptoAlgorithm CreateHmacAlgorithmByHashId( |
| + WebKit::WebCryptoAlgorithmId hashId); |
| + |
| +WebKit::WebCryptoAlgorithm CreateHmacKeyGenAlgorithm( |
| + WebKit::WebCryptoAlgorithmId hashId, |
| + unsigned hash_length); |
|
eroman
2013/10/28 23:02:00
side comment: We may want to change the parameter
padolph
2013/10/29 02:25:40
I thought that was going to be fixed in the spec.
|
| + |
| +WebKit::WebCryptoAlgorithm CreateRsaEsAlgorithm(); |
| + |
| +WebKit::WebCryptoAlgorithm CreateRsaSsaAlgorithmByKeyLen( |
| + unsigned short hash_key_length); |
| + |
| +WebKit::WebCryptoAlgorithm CreateRsaOaepAlgorithmByKeyLen( |
| + unsigned short hash_key_length); |
| + |
| +WebKit::WebCryptoAlgorithm CreateAesCbcAlgorithm(const std::vector<uint8>& iv); |
| + |
| +WebKit::WebCryptoAlgorithm CreateAesGcmAlgorithm(const std::vector<uint8>& iv, |
| + const std::vector<uint8>& additionalData, unsigned char tagLength); |
|
eroman
2013/10/28 23:02:00
use hacker_style_naming for variables in chromium
padolph
2013/10/29 02:25:40
Done.
|
| + |
| +WebKit::WebCryptoAlgorithm CreateAesCbcKeyGenAlgorithm(unsigned short length); |
| + |
| +WebKit::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm(unsigned short length); |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTI_H_ |