| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Gets the requested key length in bits for an HMAC import operation. | 73 // Gets the requested key length in bits for an HMAC import operation. |
| 74 Status GetHmacImportKeyLengthBits( | 74 Status GetHmacImportKeyLengthBits( |
| 75 const blink::WebCryptoHmacImportParams* params, | 75 const blink::WebCryptoHmacImportParams* params, |
| 76 unsigned int key_data_byte_length, | 76 unsigned int key_data_byte_length, |
| 77 unsigned int* keylen_bits); | 77 unsigned int* keylen_bits); |
| 78 | 78 |
| 79 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); | 79 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); |
| 80 | 80 |
| 81 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, | 81 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, |
| 82 blink::WebCryptoKeyUsageMask actual_usages); | 82 blink::WebCryptoKeyUsageMask actual_usages, |
| 83 bool allow_empty_usages); |
| 83 | 84 |
| 84 // Extracts the public exponent and modulus length from the Blink parameters. | 85 // Extracts the public exponent and modulus length from the Blink parameters. |
| 85 // On success it is guaranteed that: | 86 // On success it is guaranteed that: |
| 86 // * public_exponent is either 3 or 65537 | 87 // * public_exponent is either 3 or 65537 |
| 87 // * modulus_length_bits is a multiple of 8 | 88 // * modulus_length_bits is a multiple of 8 |
| 88 // * modulus_length is >= 256 | 89 // * modulus_length is >= 256 |
| 89 // * modulus_length is <= 16K | 90 // * modulus_length is <= 16K |
| 90 Status GetRsaKeyGenParameters( | 91 Status GetRsaKeyGenParameters( |
| 91 const blink::WebCryptoRsaHashedKeyGenParams* params, | 92 const blink::WebCryptoRsaHashedKeyGenParams* params, |
| 92 unsigned int* public_exponent, | 93 unsigned int* public_exponent, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 blink::WebCryptoKeyUsageMask all_public_usages, | 139 blink::WebCryptoKeyUsageMask all_public_usages, |
| 139 blink::WebCryptoKeyUsageMask all_private_usages, | 140 blink::WebCryptoKeyUsageMask all_private_usages, |
| 140 blink::WebCryptoKeyUsageMask* public_usages, | 141 blink::WebCryptoKeyUsageMask* public_usages, |
| 141 blink::WebCryptoKeyUsageMask* private_usages); | 142 blink::WebCryptoKeyUsageMask* private_usages); |
| 142 | 143 |
| 143 } // namespace webcrypto | 144 } // namespace webcrypto |
| 144 | 145 |
| 145 } // namespace content | 146 } // namespace content |
| 146 | 147 |
| 147 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 148 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| OLD | NEW |