Use size_t and uint64_t instead of long long in ed25519/.

This commit is contained in:
EinMByte 2015-08-30 10:18:29 +02:00
parent 22f9380d49
commit a24d99d678
5 changed files with 12 additions and 12 deletions

View File

@ -4,15 +4,15 @@
#include <cryptopp/sha.h> #include <cryptopp/sha.h>
inline void crypto_hash_sha512(unsigned char* output, const unsigned char* input, inline void crypto_hash_sha512(unsigned char* output, const unsigned char* input,
unsigned long long len) size_t len)
{ {
CryptoPP::SHA512 hash; CryptoPP::SHA512 hash;
hash.CalculateDigest(output, input, len); hash.CalculateDigest(output, input, len);
} }
inline void crypto_hash_sha512_2(unsigned char* out, inline void crypto_hash_sha512_2(unsigned char* out,
const unsigned char* in1, unsigned long long len1, const unsigned char* in1, size_t len1,
const unsigned char* in2, unsigned long long len2 const unsigned char* in2, size_t len2
) )
{ {
CryptoPP::SHA512 hash; CryptoPP::SHA512 hash;
@ -22,10 +22,10 @@ inline void crypto_hash_sha512_2(unsigned char* out,
} }
inline void crypto_hash_sha512_3(unsigned char* out, inline void crypto_hash_sha512_3(unsigned char* out,
const unsigned char* in1, unsigned long long len1, const unsigned char* in1, size_t len1,
const unsigned char* in2, unsigned long long len2, const unsigned char* in2, size_t len2,
const unsigned char* in3, unsigned long long len3 const unsigned char* in3, size_t len3
) )
{ {
CryptoPP::SHA512 hash; CryptoPP::SHA512 hash;
hash.Update(in1, len1); hash.Update(in1, len1);

View File

@ -8,13 +8,13 @@ int ed25519_ref10_pubkey(unsigned char* pk, const unsigned char* sk);
int ed25519_ref10_open( int ed25519_ref10_open(
const unsigned char* sig, const unsigned char* sig,
const unsigned char* m, unsigned long long mlen, const unsigned char* m, size_t mlen,
const unsigned char*pk const unsigned char*pk
); );
int ed25519_ref10_sign( int ed25519_ref10_sign(
unsigned char* sig, unsigned char* sig,
const unsigned char* m, unsigned long long mlen, const unsigned char* m, size_t mlen,
const unsigned char* sk, const unsigned char* pk const unsigned char* sk, const unsigned char* pk
); );

View File

@ -14,7 +14,7 @@ static unsigned char equal(signed char b,signed char c)
static unsigned char negative(signed char b) static unsigned char negative(signed char b)
{ {
unsigned long long x = b; /* 18446744073709551361..18446744073709551615: yes; 0..255: no */ uint64_t x = b; /* 18446744073709551361..18446744073709551615: yes; 0..255: no */
x >>= 63; /* 1: yes; 0: no */ x >>= 63; /* 1: yes; 0: no */
return x; return x;
} }

View File

@ -7,7 +7,7 @@
int crypto_sign_open( int crypto_sign_open(
const unsigned char* sig, const unsigned char* sig,
const unsigned char* m, unsigned long long mlen, const unsigned char* m, size_t mlen,
const unsigned char* pk const unsigned char* pk
) )
{ {

View File

@ -6,7 +6,7 @@
int crypto_sign( int crypto_sign(
unsigned char *sig, unsigned char *sig,
const unsigned char* m, unsigned long long mlen, const unsigned char* m, size_t mlen,
const unsigned char* sk, const unsigned char* pk const unsigned char* sk, const unsigned char* pk
) )
{ {