Commit 7b33ea73 authored by George Kadianakis's avatar George Kadianakis
Browse files

make it compile again

parent 569fc677
Pipeline #10166 failed with stage
in 24 minutes and 7 seconds
......@@ -2,6 +2,8 @@
Ed25519 batch verification
*/
#include <stdio.h>
#define max_batch_size 64
#define heap_batch_size ((max_batch_size * 2) + 1)
......@@ -215,7 +217,7 @@ ED25519_FN(ed25519_sign_open_batch) (const unsigned char **m, size_t *mlen, cons
while (num > 3) {
batchsize = (num > max_batch_size) ? max_batch_size : num;
printf("batchsize %d\n", batchsize);
printf("batchsize %d\n", (int)batchsize);
/* generate r (scalars[batchsize+1]..scalars[2*batchsize] */
ED25519_FN(ed25519_randombytes_unsafe) (batch.r, batchsize * 16);
......
......@@ -21,6 +21,8 @@
#include <sys/stat.h>
#endif
#include <stdio.h>
#include "lib/ctime/di_ops.h"
#include "lib/crypt_ops/crypto_curve25519.h"
#include "lib/crypt_ops/crypto_digest.h"
......
......@@ -3444,10 +3444,9 @@ test_crypto_ed25519_zip215vectors(void *arg)
{
ed25519_public_key_t pk;
ed25519_signature_t sig;
uint8_t sk_seed[32];
base16_decode(pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode(sig.sig, 64, zip215vectors[i].sig, 64 * 2);
if (ed25519_checksig(&sig, msg, msg_len, &pk) == 0) {
base16_decode((char*)pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode((char*)sig.sig, 64, zip215vectors[i].sig, 64 * 2);
if (ed25519_checksig(&sig, (uint8_t*)msg, msg_len, &pk) == 0) {
printf("%d: pass\n", i);
} /* else {
printf("%d: fail\n", i);
......@@ -3469,11 +3468,10 @@ test_crypto_ed25519_zip215vectors_batch(void *arg)
{
ed25519_public_key_t pk;
ed25519_signature_t sig;
uint8_t sk_seed[32];
base16_decode(pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode(sig.sig, 64, zip215vectors[i].sig, 64 * 2);
base16_decode((char*)pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode((char*)sig.sig, 64, zip215vectors[i].sig, 64 * 2);
ed25519_checkable_t ch[] = {
{ &pk, sig, msg, msg_len },
{ &pk, sig, (uint8_t*)msg, msg_len },
};
int okay[1];
if (ed25519_checksig_batch(okay, ch, 1) == 0) {
......@@ -3499,14 +3497,13 @@ test_crypto_ed25519_zip215vectors_batch4(void *arg)
{
ed25519_public_key_t pk;
ed25519_signature_t sig;
uint8_t sk_seed[32];
base16_decode(pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode(sig.sig, 64, zip215vectors[i].sig, 64 * 2);
base16_decode((char*)pk.pubkey, 32, zip215vectors[i].pub, 32*2);
base16_decode((char*)sig.sig, 64, zip215vectors[i].sig, 64 * 2);
ed25519_checkable_t ch[] = {
{ &pk, sig, msg, msg_len },
{ &pk, sig, msg, msg_len },
{ &pk, sig, msg, msg_len },
{ &pk, sig, msg, msg_len },
{ &pk, sig, (uint8_t*)msg, msg_len },
{ &pk, sig, (uint8_t*)msg, msg_len },
{ &pk, sig, (uint8_t*)msg, msg_len },
{ &pk, sig, (uint8_t*)msg, msg_len },
};
int okay[4];
if (ed25519_checksig_batch(okay, ch, 4) == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment