No matching function for call to 'Curve25519::dh1(unsigned int [32], unsigned int [32])' Curve25519::dh1(k, f);

#include<Curve25519.h>
#include<SoftwareSerial.h>
unsigned int k[32]= {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

unsigned int f[32] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

void setup() {
Serial.begin(9600);
Curve25519::dh1(k, f);
Serial.println(k);

}

I want to use ECDH to generate a key. I am unable to use dh1() as its showing above error. Please help me to rectify it.

Welcome

The function is declared like this :

static void dh1(uint8_t k[32], uint8_t f[32]);

It expects parameters of type uint8_t not unsigned int, so the obvious solution is to change the data type of your arrays to uint8_t.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.