This source file includes following definitions.
- Create
- SetFactoryForTesting
#include "crypto/ec_signature_creator.h"
#include "base/logging.h"
#include "crypto/ec_signature_creator_impl.h"
namespace crypto {
namespace {
ECSignatureCreatorFactory* g_factory_ = NULL;
}
ECSignatureCreator* ECSignatureCreator::Create(ECPrivateKey* key) {
if (g_factory_)
return g_factory_->Create(key);
return new ECSignatureCreatorImpl(key);
}
void ECSignatureCreator::SetFactoryForTesting(
ECSignatureCreatorFactory* factory) {
DCHECK(!g_factory_ || !factory);
g_factory_ = factory;
}
}