OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 blink::WebCryptoAlgorithmId id, | 44 blink::WebCryptoAlgorithmId id, |
45 blink::WebCryptoAlgorithmId hash_id); | 45 blink::WebCryptoAlgorithmId hash_id); |
46 | 46 |
47 // Returns true if the set bits in b make up a subset of the set bits in a. | 47 // Returns true if the set bits in b make up a subset of the set bits in a. |
48 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a, | 48 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a, |
49 blink::WebCryptoKeyUsageMask b); | 49 blink::WebCryptoKeyUsageMask b); |
50 | 50 |
51 bool KeyUsageAllows(const blink::WebCryptoKey& key, | 51 bool KeyUsageAllows(const blink::WebCryptoKey& key, |
52 const blink::WebCryptoKeyUsage usage); | 52 const blink::WebCryptoKeyUsage usage); |
53 | 53 |
54 bool IsAlgorithmRsa(blink::WebCryptoAlgorithmId alg_id); | |
55 | |
56 Status GetAesGcmTagLengthInBits(const blink::WebCryptoAesGcmParams* params, | 54 Status GetAesGcmTagLengthInBits(const blink::WebCryptoAesGcmParams* params, |
57 unsigned int* tag_length_bits); | 55 unsigned int* tag_length_bits); |
58 | 56 |
59 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, | 57 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, |
60 unsigned int* keylen_bits); | 58 unsigned int* keylen_bits); |
61 | 59 |
62 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, | 60 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, |
63 unsigned int* keylen_bits); | 61 unsigned int* keylen_bits); |
64 | 62 |
65 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); | 63 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); |
(...skipping 10 matching lines...) Expand all Loading... |
76 Status GetRsaKeyGenParameters( | 74 Status GetRsaKeyGenParameters( |
77 const blink::WebCryptoRsaHashedKeyGenParams* params, | 75 const blink::WebCryptoRsaHashedKeyGenParams* params, |
78 unsigned int* public_exponent, | 76 unsigned int* public_exponent, |
79 unsigned int* modulus_length_bits); | 77 unsigned int* modulus_length_bits); |
80 | 78 |
81 } // namespace webcrypto | 79 } // namespace webcrypto |
82 | 80 |
83 } // namespace content | 81 } // namespace content |
84 | 82 |
85 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 83 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |