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

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

Issue 204013006: [webcrypto] Add length parameter to HmacKeyAlgorithm. (blink) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « Source/modules/crypto/HmacKeyAlgorithm.h ('k') | Source/modules/crypto/HmacKeyAlgorithm.idl » ('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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 30 matching lines...) Expand all
41 return adoptRefWillBeNoop(new HmacKeyAlgorithm(algorithm)); 41 return adoptRefWillBeNoop(new HmacKeyAlgorithm(algorithm));
42 } 42 }
43 43
44 KeyAlgorithm* HmacKeyAlgorithm::hash() 44 KeyAlgorithm* HmacKeyAlgorithm::hash()
45 { 45 {
46 if (!m_hash) 46 if (!m_hash)
47 m_hash = KeyAlgorithm::createHash(m_algorithm.hmacParams()->hash()); 47 m_hash = KeyAlgorithm::createHash(m_algorithm.hmacParams()->hash());
48 return m_hash.get(); 48 return m_hash.get();
49 } 49 }
50 50
51 unsigned HmacKeyAlgorithm::length()
52 {
53 return m_algorithm.hmacParams()->lengthBits();
54 }
55
51 void HmacKeyAlgorithm::trace(Visitor* visitor) 56 void HmacKeyAlgorithm::trace(Visitor* visitor)
52 { 57 {
53 KeyAlgorithm::trace(visitor); 58 KeyAlgorithm::trace(visitor);
54 visitor->trace(m_hash); 59 visitor->trace(m_hash);
55 } 60 }
56 61
57 HmacKeyAlgorithm::HmacKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm ) 62 HmacKeyAlgorithm::HmacKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm )
58 : KeyAlgorithm(algorithm) 63 : KeyAlgorithm(algorithm)
59 { 64 {
60 ScriptWrappable::init(this); 65 ScriptWrappable::init(this);
61 } 66 }
62 67
63 } // namespace WebCore 68 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/HmacKeyAlgorithm.h ('k') | Source/modules/crypto/HmacKeyAlgorithm.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698