Uso de esta libreria para funciones criptograficas con curvas elipticas.
Dependencies: mbed tinydtls lwip-mbed-2010
main.cpp
- Committer:
- saranieves92
- Date:
- 2015-02-08
- Revision:
- 1:b7f306783a3c
- Parent:
- 0:7197fcdec294
File content as of revision 1:b7f306783a3c:
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx DigitalOut myled(LED1); int main() { //ecc_gen_pub_key(const uint32_t *priv_key, uint32_t *pub_x, uint32_t *pub_y) /* * d: private key on the curve secp256r1 (32 bytes) * e: hash to sign (32 bytes) * k: random data, this must be changed for every signature (32 bytes) * * output: * r: r value of the signature (36 bytes) * s: s value of the signature (36 bytes) * * return: * 0: everything is ok * -1: can not create signature, try again with different k. */ /*uint32_t kPrivada=1147483647; uint32_t hash=2147483117; uint32_t ran=1147483147; uint32_t firma_r; uint32_t firma_s; if (ecc_ecdsa_sign(&kPrivada, &hash, &ran, &firma_r, &firma_s)==0) pc.printf("Hola Mundo\n"); else pc.printf("Adios Mundo Cruel\n"); */ }