| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ | 5 #ifndef CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ |
| 6 #define CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ | 6 #define CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> |
| 11 |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "crypto/ec_signature_creator.h" | 14 #include "crypto/ec_signature_creator.h" |
| 13 | 15 |
| 14 namespace crypto { | 16 namespace crypto { |
| 15 | 17 |
| 16 class ECSignatureCreatorImpl : public ECSignatureCreator { | 18 class ECSignatureCreatorImpl : public ECSignatureCreator { |
| 17 public: | 19 public: |
| 18 explicit ECSignatureCreatorImpl(ECPrivateKey* key); | 20 explicit ECSignatureCreatorImpl(ECPrivateKey* key); |
| 19 ~ECSignatureCreatorImpl() override; | 21 ~ECSignatureCreatorImpl() override; |
| 20 | 22 |
| 21 bool Sign(const uint8_t* data, | 23 bool Sign(const uint8_t* data, |
| 22 int data_len, | 24 int data_len, |
| 23 std::vector<uint8_t>* signature) override; | 25 std::vector<uint8_t>* signature) override; |
| 24 | 26 |
| 25 bool DecodeSignature(const std::vector<uint8_t>& der_sig, | 27 bool DecodeSignature(const std::vector<uint8_t>& der_sig, |
| 26 std::vector<uint8_t>* out_raw_sig) override; | 28 std::vector<uint8_t>* out_raw_sig) override; |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 ECPrivateKey* key_; | 31 ECPrivateKey* key_; |
| 30 | 32 |
| 31 DISALLOW_COPY_AND_ASSIGN(ECSignatureCreatorImpl); | 33 DISALLOW_COPY_AND_ASSIGN(ECSignatureCreatorImpl); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 } // namespace crypto | 36 } // namespace crypto |
| 35 | 37 |
| 36 #endif // CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ | 38 #endif // CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_ |
| OLD | NEW |