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