sara matheu / Mbed 2 deprecated tiny-dtls

Dependencies:   mbed tinydtls lwip-mbed-2010

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 Serial pc(USBTX, USBRX); // tx, rx
00003 DigitalOut myled(LED1);
00004 
00005 int main() {
00006     
00007     
00008     //ecc_gen_pub_key(const uint32_t *priv_key, uint32_t *pub_x, uint32_t *pub_y)
00009     /*
00010  *  d: private key on the curve secp256r1 (32 bytes)
00011  *  e: hash to sign (32 bytes)
00012  *  k: random data, this must be changed for every signature (32 bytes)
00013  *
00014  * output:
00015  *  r: r value of the signature (36 bytes)
00016  *  s: s value of the signature (36 bytes)
00017  *
00018  * return:
00019  *   0: everything is ok
00020  *  -1: can not create signature, try again with different k.
00021  */
00022    /*uint32_t kPrivada=1147483647;
00023     uint32_t hash=2147483117;
00024     uint32_t ran=1147483147;
00025     uint32_t firma_r;
00026     uint32_t firma_s;
00027     if (ecc_ecdsa_sign(&kPrivada, &hash, &ran, &firma_r, &firma_s)==0)  pc.printf("Hola Mundo\n");
00028     else  pc.printf("Adios Mundo Cruel\n");
00029     
00030     */
00031 }