Skip to content

Commit

Permalink
fix incompatibility issues with LLP64 data models
Browse files Browse the repository at this point in the history
This is also a fixup of a921112

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
  • Loading branch information
sjaeckel committed Sep 12, 2022
1 parent ca92434 commit 1873838
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/headers/tomcrypt_private.h
Expand Up @@ -345,13 +345,13 @@ int tweetnacl_crypto_sign_open(
int *stat,
unsigned char *m,unsigned long long *mlen,
const unsigned char *sm,unsigned long long smlen,
const unsigned char *ctx, unsigned long cs,
const unsigned char *ctx, unsigned long long cs,
const unsigned char *pk);
int tweetnacl_crypto_sign_keypair(prng_state *prng, int wprng, unsigned char *pk,unsigned char *sk);
int tweetnacl_crypto_sk_to_pk(unsigned char *pk, const unsigned char *sk);
int tweetnacl_crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p);
int tweetnacl_crypto_scalarmult_base(unsigned char *q,const unsigned char *n);
int tweetnacl_crypto_ph(unsigned char *out, const unsigned char *msg, unsigned long msglen);
int tweetnacl_crypto_ph(unsigned char *out, const unsigned char *msg, unsigned long long msglen);

typedef int (*sk_to_pk)(unsigned char *pk ,const unsigned char *sk);
int ec25519_import_pkcs8(const unsigned char *in, unsigned long inlen,
Expand Down
4 changes: 2 additions & 2 deletions src/pk/ec25519/tweetnacl.c
Expand Up @@ -448,7 +448,7 @@ static int unpackneg(gf r[4],const u8 p[32])
return 0;
}

int tweetnacl_crypto_sign_open(int *stat, u8 *m,u64 *mlen,const u8 *sm,u64 smlen,const u8 *ctx,size_t cs,const u8 *pk)
int tweetnacl_crypto_sign_open(int *stat, u8 *m,u64 *mlen,const u8 *sm,u64 smlen,const u8 *ctx,u64 cs,const u8 *pk)
{
u64 i;
u8 s[32],t[32],h[64];
Expand Down Expand Up @@ -485,7 +485,7 @@ int tweetnacl_crypto_sign_open(int *stat, u8 *m,u64 *mlen,const u8 *sm,u64 smlen
return CRYPT_OK;
}

int tweetnacl_crypto_ph(u8 *out,const u8 *msg,size_t msglen)
int tweetnacl_crypto_ph(u8 *out,const u8 *msg,u64 msglen)
{
return tweetnacl_crypto_hash(out, msg, msglen);
}
2 changes: 1 addition & 1 deletion tests/multi_test.c
Expand Up @@ -15,7 +15,7 @@ int multi_test(void)

/* HASH testing */
len = sizeof(buf[0]);
#if defined(ENDIAN_32BITWORD) || defined(_MSC_VER)
#if defined(ENDIAN_32BITWORD) || defined(_WIN32)
len2 = 0x80000000UL;
#else
/* Check against the max. input limit of SHA-1 as of RFC8017 */
Expand Down

0 comments on commit 1873838

Please sign in to comment.