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 #include "crypto/ec_signature_creator_impl.h" | 5 #include "crypto/ec_signature_creator_impl.h" |
6 | 6 |
7 #include <openssl/bn.h> | |
8 #include <openssl/ec.h> | |
9 #include <openssl/ecdsa.h> | |
10 #include <openssl/evp.h> | |
11 #include <openssl/sha.h> | |
12 | |
13 #include "base/logging.h" | 7 #include "base/logging.h" |
14 #include "crypto/ec_private_key.h" | 8 #include "crypto/ec_private_key.h" |
15 #include "crypto/openssl_util.h" | 9 #include "crypto/openssl_util.h" |
16 #include "crypto/scoped_openssl_types.h" | 10 #include "crypto/scoped_openssl_types.h" |
| 11 #include "third_party/boringssl/src/include/openssl/bn.h" |
| 12 #include "third_party/boringssl/src/include/openssl/digest.h" |
| 13 #include "third_party/boringssl/src/include/openssl/ecdsa.h" |
| 14 #include "third_party/boringssl/src/include/openssl/evp.h" |
17 | 15 |
18 namespace crypto { | 16 namespace crypto { |
19 | 17 |
20 ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key) | 18 ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key) |
21 : key_(key) { | 19 : key_(key) { |
22 EnsureOpenSSLInit(); | 20 EnsureOpenSSLInit(); |
23 } | 21 } |
24 | 22 |
25 ECSignatureCreatorImpl::~ECSignatureCreatorImpl() {} | 23 ECSignatureCreatorImpl::~ECSignatureCreatorImpl() {} |
26 | 24 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (!BN_bn2bin_padded(&result[0], kMaxBytesPerBN, ecdsa_sig->r) || | 63 if (!BN_bn2bin_padded(&result[0], kMaxBytesPerBN, ecdsa_sig->r) || |
66 !BN_bn2bin_padded(&result[kMaxBytesPerBN], kMaxBytesPerBN, | 64 !BN_bn2bin_padded(&result[kMaxBytesPerBN], kMaxBytesPerBN, |
67 ecdsa_sig->s)) { | 65 ecdsa_sig->s)) { |
68 return false; | 66 return false; |
69 } | 67 } |
70 out_raw_sig->swap(result); | 68 out_raw_sig->swap(result); |
71 return true; | 69 return true; |
72 } | 70 } |
73 | 71 |
74 } // namespace crypto | 72 } // namespace crypto |
OLD | NEW |