~ubuntu-branches/ubuntu/intrepid/libcrypto++/intrepid

« back to all changes in this revision

Viewing changes to ecp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Machard
  • Date: 2004-08-27 12:35:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040827123505-7evgxiu7k8memiyk
Tags: 5.2.1a-1
* Urgency set to high because lastest upload was unclean
* Rename libcrypto++-5.2.1.orig.tar.gz in  libcrypto++-5.2.1a.orig.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ecp.cpp - written and placed in the public domain by Wei Dai
2
2
 
3
3
#include "pch.h"
 
4
 
 
5
#ifndef CRYPTOPP_IMPORTS
 
6
 
4
7
#include "ecp.h"
5
8
#include "asn.h"
6
9
#include "nbtheory.h"
7
10
 
8
11
#include "algebra.cpp"
9
 
#include "eprecomp.cpp"
10
12
 
11
13
NAMESPACE_BEGIN(CryptoPP)
12
14
 
193
195
 
194
196
const ECP::Point& ECP::Identity() const
195
197
{
196
 
        static const Point zero;
197
 
        return zero;
 
198
        return Singleton<Point>().Ref();
198
199
}
199
200
 
200
201
const ECP::Point& ECP::Inverse(const Point &P) const
463
464
                return AbstractGroup<Point>::CascadeScalarMultiply(P, k1, Q, k2);
464
465
}
465
466
 
466
 
// ********************************************************
467
 
 
468
 
void EcPrecomputation<ECP>::SetCurve(const ECP &ec)
469
 
{
470
 
        m_ec.reset(new ECP(ec, true));
471
 
        m_ecOriginal = ec;
472
 
}
473
 
 
474
 
template class AbstractGroup<ECP::Point>;
475
 
template class DL_FixedBasePrecomputationImpl<ECP::Point>;
476
 
 
477
467
NAMESPACE_END
 
468
 
 
469
#endif