OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |