Build fix to eliminate strict aliasing warnings, and a bug fix.

This commit is contained in:
Adam Ierymenko 2013-09-16 19:25:31 +00:00
parent 77f8d75529
commit de5cc82b5b
2 changed files with 10 additions and 2 deletions

View File

@ -33,6 +33,7 @@
#include "C25519.hpp"
#include "Utils.hpp"
#include "SHA512.hpp"
#include "Buffer.hpp"
namespace ZeroTier {
@ -1895,9 +1896,16 @@ static void p1p1_to_p2(ge25519_p2 *r, const ge25519_p1p1 *p)
fe25519_mul(&r->z, &p->z, &p->t);
}
static void p1p1_to_p2_2(ge25519_p3 *r, const ge25519_p1p1 *p)
{
fe25519_mul(&r->x, &p->x, &p->t);
fe25519_mul(&r->y, &p->y, &p->z);
fe25519_mul(&r->z, &p->z, &p->t);
}
static void p1p1_to_p3(ge25519_p3 *r, const ge25519_p1p1 *p)
{
p1p1_to_p2((ge25519_p2 *)r, p);
p1p1_to_p2_2(r, p);
fe25519_mul(&r->t, &p->x, &p->y);
}

View File

@ -572,7 +572,7 @@ public:
char *end = dest + len;
while ((*dest++ = *src++)) {
if (dest == end) {
dest[len - 1] = (char)0;
--dest = (char)0;
return false;
}
}