Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: content/renderer/webcrypto/webcrypto_util.h

Issue 118623002: [webcrypto] Add raw symmetric key AES-KW wrap/unwrap for NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // bytes. 125 // bytes.
126 static Status ErrorIncorrectSizeAesCbcIv(); 126 static Status ErrorIncorrectSizeAesCbcIv();
127 127
128 // The data provided to an encrypt/decrypt/sign/verify operation was too 128 // The data provided to an encrypt/decrypt/sign/verify operation was too
129 // large. This can either represent an internal limitation (for instance 129 // large. This can either represent an internal limitation (for instance
130 // representing buffer lengths as uints), or an algorithm restriction (for 130 // representing buffer lengths as uints), or an algorithm restriction (for
131 // instance RSAES can operation on messages relative to the length of the 131 // instance RSAES can operation on messages relative to the length of the
132 // key's modulus). 132 // key's modulus).
133 static Status ErrorDataTooLarge(); 133 static Status ErrorDataTooLarge();
134 134
135 // The data provided to an encrypt/decrypt/sign/verify operation was too
136 // small. This usually represents an algorithm restriction (for instance
137 // AES-KW requires a minimum of 24 bytes input data).
138 static Status ErrorDataTooSmall();
139
135 // Something was unsupported or unimplemented. This can mean the algorithm in 140 // Something was unsupported or unimplemented. This can mean the algorithm in
136 // question was unsupported, some parameter combination was unsupported, or 141 // question was unsupported, some parameter combination was unsupported, or
137 // something has not yet been implemented. 142 // something has not yet been implemented.
138 static Status ErrorUnsupported(); 143 static Status ErrorUnsupported();
139 144
140 // Something unexpected happened in the code, which implies there is a 145 // Something unexpected happened in the code, which implies there is a
141 // source-level bug. These should not happen, but safer to fail than simply 146 // source-level bug. These should not happen, but safer to fail than simply
142 // DCHECK. 147 // DCHECK.
143 static Status ErrorUnexpected(); 148 static Status ErrorUnexpected();
144 149
145 // The authentication tag length specified for AES-GCM encrypt/decrypt was 150 // The authentication tag length specified for AES-GCM encrypt/decrypt was
146 // either greater than 128 bits, or it was not a multiple of 8 bits. 151 // either greater than 128 bits, or it was not a multiple of 8 bits.
147 // (zero length is allowed). 152 // (zero length is allowed).
148 static Status ErrorInvalidAesGcmTagLength(); 153 static Status ErrorInvalidAesGcmTagLength();
149 154
155 // The input data given to an AES-KW encrypt/decrypt operation was not a
156 // multiple of 8 bytes, as required by RFC 3394.
157 static Status ErrorInvalidAesKwDataLength();
158
150 // The "publicExponent" used to generate a key was invalid: either no bytes 159 // The "publicExponent" used to generate a key was invalid: either no bytes
151 // were specified, or the number was too large to fit into an "unsigned long" 160 // were specified, or the number was too large to fit into an "unsigned long"
152 // (implemention limitation), or the exponent was zero. 161 // (implemention limitation), or the exponent was zero.
153 static Status ErrorGenerateKeyPublicExponent(); 162 static Status ErrorGenerateKeyPublicExponent();
154 163
155 // The algorithm was null when importing a raw-formatted key. In this case it 164 // The algorithm was null when importing a raw-formatted key. In this case it
156 // is required. 165 // is required.
157 static Status ErrorMissingAlgorithmImportRawKey(); 166 static Status ErrorMissingAlgorithmImportRawKey();
158 167
159 // The modulus bytes were empty when importing an RSA public key. 168 // The modulus bytes were empty when importing an RSA public key.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 uint8 tag_length_bytes); 265 uint8 tag_length_bytes);
257 266
258 // Returns the internal block size for SHA-* 267 // Returns the internal block size for SHA-*
259 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); 268 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id);
260 269
261 } // namespace webcrypto 270 } // namespace webcrypto
262 271
263 } // namespace content 272 } // namespace content
264 273
265 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 274 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698