Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 403197
Collapse All | Expand All

(-)a/algebra.cpp (-2 / +2 lines)
Lines 58-64 template <class T> const T& AbstractEuclideanDomain<T>::Gcd(const Element &a, co Link Here
58
	Element g[3]={b, a};
58
	Element g[3]={b, a};
59
	unsigned int i0=0, i1=1, i2=2;
59
	unsigned int i0=0, i1=1, i2=2;
60
60
61
	while (!Equal(g[i1], this->Identity()))
61
	while (!this->Equal(g[i1], this->Identity()))
62
	{
62
	{
63
		g[i2] = Mod(g[i0], g[i1]);
63
		g[i2] = Mod(g[i0], g[i1]);
64
		unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;
64
		unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;
Lines 74-80 template <class T> const typename QuotientRing<T>::Element& QuotientRing<T>::Mul Link Here
74
	Element y;
74
	Element y;
75
	unsigned int i0=0, i1=1, i2=2;
75
	unsigned int i0=0, i1=1, i2=2;
76
76
77
	while (!Equal(g[i1], Identity()))
77
	while (!this->Equal(g[i1], Identity()))
78
	{
78
	{
79
		// y = g[i0] / g[i1];
79
		// y = g[i0] / g[i1];
80
		// g[i2] = g[i0] % g[i1];
80
		// g[i2] = g[i0] % g[i1];
(-)a/eccrypto.cpp (-3 / +3 lines)
Lines 435-441 template <class EC> void DL_GroupParameters_EC<EC>::Initialize(const OID &oid) Link Here
435
	StringSource ssG(param.g, true, new HexDecoder);
435
	StringSource ssG(param.g, true, new HexDecoder);
436
	Element G;
436
	Element G;
437
	bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable());
437
	bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable());
438
	SetSubgroupGenerator(G);
438
	this->SetSubgroupGenerator(G);
439
	assert(result);
439
	assert(result);
440
440
441
	StringSource ssN(param.n, true, new HexDecoder);
441
	StringSource ssN(param.n, true, new HexDecoder);
Lines 591-597 bool DL_GroupParameters_EC<EC>::ValidateElement(unsigned int level, const Elemen Link Here
591
	if (level >= 2 && pass)
591
	if (level >= 2 && pass)
592
	{
592
	{
593
		const Integer &q = GetSubgroupOrder();
593
		const Integer &q = GetSubgroupOrder();
594
		Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q);
594
		Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q);
595
		pass = pass && IsIdentity(gq);
595
		pass = pass && IsIdentity(gq);
596
	}
596
	}
597
	return pass;
597
	return pass;
Lines 629-635 void DL_PublicKey_EC<EC>::BERDecodePublicKey(BufferedTransformation &bt, bool pa Link Here
629
	typename EC::Point P;
629
	typename EC::Point P;
630
	if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))
630
	if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))
631
		BERDecodeError();
631
		BERDecodeError();
632
	SetPublicElement(P);
632
	this->SetPublicElement(P);
633
}
633
}
634
634
635
template <class EC>
635
template <class EC>
(-)a/eccrypto.h (-5 / +5 lines)
Lines 43-49 public: Link Here
43
	void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
43
	void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
44
	{
44
	{
45
		this->m_groupPrecomputation.SetCurve(ec);
45
		this->m_groupPrecomputation.SetCurve(ec);
46
		SetSubgroupGenerator(G);
46
		this->SetSubgroupGenerator(G);
47
		m_n = n;
47
		m_n = n;
48
		m_k = k;
48
		m_k = k;
49
	}
49
	}
Lines 145-153 public: Link Here
145
	typedef typename EC::Point Element;
145
	typedef typename EC::Point Element;
146
146
147
	void Initialize(const DL_GroupParameters_EC<EC> &params, const Element &Q)
147
	void Initialize(const DL_GroupParameters_EC<EC> &params, const Element &Q)
148
		{this->AccessGroupParameters() = params; SetPublicElement(Q);}
148
		{this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
149
	void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
149
	void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
150
		{this->AccessGroupParameters().Initialize(ec, G, n); SetPublicElement(Q);}
150
		{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}
151
151
152
	// X509PublicKey
152
	// X509PublicKey
153
	void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
153
	void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
Lines 166-174 public: Link Here
166
	void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
166
	void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
167
		{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}
167
		{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}
168
	void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC<EC> &params)
168
	void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC<EC> &params)
169
		{GenerateRandom(rng, params);}
169
		{this->GenerateRandom(rng, params);}
170
	void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
170
	void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
171
		{GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
171
		{this->GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
172
172
173
	// PKCS8PrivateKey
173
	// PKCS8PrivateKey
174
	void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
174
	void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
(-)a/panama.cpp (-1 / +1 lines)
Lines 422-428 void PanamaHash<B>::TruncatedFinal(byte *hash, size_t size) Link Here
422
{
422
{
423
	this->ThrowIfInvalidTruncatedSize(size);
423
	this->ThrowIfInvalidTruncatedSize(size);
424
424
425
	PadLastBlock(this->BLOCKSIZE, 0x01);
425
	this->PadLastBlock(this->BLOCKSIZE, 0x01);
426
	
426
	
427
	HashEndianCorrectedBlock(this->m_data);
427
	HashEndianCorrectedBlock(this->m_data);
428
428
(-)a/secblock.h (-1 / +1 lines)
Lines 88-94 public: Link Here
88
88
89
	pointer allocate(size_type n, const void * = NULL)
89
	pointer allocate(size_type n, const void * = NULL)
90
	{
90
	{
91
		CheckSize(n);
91
		this->CheckSize(n);
92
		if (n == 0)
92
		if (n == 0)
93
			return NULL;
93
			return NULL;
94
94

Return to bug 403197