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

Side by Side Diff: Source/modules/crypto/NormalizeAlgorithm.cpp

Issue 184453005: [webcrypto] Change HMAC key generation length from bytes to bits. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add rebased tests Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/crypto/generateKey-expected.txt ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 return false; 470 return false;
471 471
472 params = adoptPtr(new blink::WebCryptoHmacImportParams(hash)); 472 params = adoptPtr(new blink::WebCryptoHmacImportParams(hash));
473 return true; 473 return true;
474 } 474 }
475 475
476 // Defined by the WebCrypto spec as: 476 // Defined by the WebCrypto spec as:
477 // 477 //
478 // dictionary HmacKeyGenParams : Algorithm { 478 // dictionary HmacKeyGenParams : Algorithm {
479 // AlgorithmIdentifier hash; 479 // AlgorithmIdentifier hash;
480 // // The length (in bytes) of the key to generate. If unspecified, the 480 // // The length (in bits) of the key to generate. If unspecified, the
481 // // recommended length will be used, which is the size of the associated hash function's block 481 // // recommended length will be used, which is the size of the associated hash function's block
482 // // size. 482 // // size.
483 // unsigned long length; 483 // unsigned long length;
484 // }; 484 // };
485 bool parseHmacKeyGenParams(const Dictionary& raw, OwnPtr<blink::WebCryptoAlgorit hmParams>& params, const ErrorContext& context, String& errorDetails) 485 bool parseHmacKeyGenParams(const Dictionary& raw, OwnPtr<blink::WebCryptoAlgorit hmParams>& params, const ErrorContext& context, String& errorDetails)
486 { 486 {
487 blink::WebCryptoAlgorithm hash; 487 blink::WebCryptoAlgorithm hash;
488 if (!parseHash(raw, hash, context, errorDetails)) 488 if (!parseHash(raw, hash, context, errorDetails))
489 return false; 489 return false;
490 490
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 702 }
703 return true; 703 return true;
704 } 704 }
705 705
706 const char* algorithmIdToName(blink::WebCryptoAlgorithmId id) 706 const char* algorithmIdToName(blink::WebCryptoAlgorithmId id)
707 { 707 {
708 return AlgorithmRegistry::instance().lookupAlgorithmById(id)->algorithmName; 708 return AlgorithmRegistry::instance().lookupAlgorithmById(id)->algorithmName;
709 } 709 }
710 710
711 } // namespace WebCore 711 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/crypto/generateKey-expected.txt ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698