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