Chromium Code Reviews| Index: crypto/ec_signature_creator.h |
| diff --git a/crypto/ec_signature_creator.h b/crypto/ec_signature_creator.h |
| index b557daaf7b0193d8708fd705e77475572251f823..a9cb65b4d3d3e766791d809272aff2a14178ee23 100644 |
| --- a/crypto/ec_signature_creator.h |
| +++ b/crypto/ec_signature_creator.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CRYPTO_EC_SIGNATURE_CREATOR_H_ |
| #define CRYPTO_EC_SIGNATURE_CREATOR_H_ |
| +#include <string> |
| #include <vector> |
| #include "base/basictypes.h" |
| @@ -31,7 +32,7 @@ class CRYPTO_EXPORT ECSignatureCreator { |
| // Create an instance. The caller must ensure that the provided PrivateKey |
| // instance outlives the created ECSignatureCreator. |
| - // TODO(rch): This is currently hard coded to use SHA1. Ideally, we should |
| + // TODO(rch): This is currently hard coded to use SHA256. Ideally, we should |
| // pass in the hash algorithm identifier. |
| static ECSignatureCreator* Create(ECPrivateKey* key); |
| @@ -50,6 +51,13 @@ class CRYPTO_EXPORT ECSignatureCreator { |
| virtual bool Sign(const uint8* data, |
| int data_len, |
| std::vector<uint8>* signature) = 0; |
| + |
| + // DecodeSignature converts from a DER encoded ECDSA-Sig-Value (as produced |
| + // by Sign) to a `raw' ECDSA signature which consists of a pair of |
| + // big-endian, zero-padded, 256-bit integers, r and s. On success it returns |
|
wtc
2012/09/12 22:06:27
The size of r and s depends on the ECPrivateKey ob
agl
2012/09/13 20:17:59
I've changed the output to also be a std::vector<u
|
| + // true and puts the raw signature into |out_raw_sig|. |
| + virtual bool DecodeSignature(const std::vector<uint8>& signature, |
| + std::string* out_raw_sig) = 0; |
| }; |
| } // namespace crypto |