sara matheu
/
mbed_cyassl
rsa con cyassl
Diff: main.cpp
- Revision:
- 0:a0ac34d8494a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 31 19:31:44 2015 +0000 @@ -0,0 +1,28 @@ +#include <mbed.h> +#include <time.h> +#include <string> +#include <stdlib.h> +#include <cstdio> +#include <cstdlib> +#include <alloca.h> +#include <cyassl/asn.h> +#include <cyassl/ctc_rsa.h> + +Serial pc(USBTX, USBRX); // tx, rx + +int main() { + clock_t t_ini, t_fin; + double secs; + RsaKey genKey; + RNG rng; + InitRng(&rng); + for (int i=0; i<30;i++){ + t_ini = clock(); + InitRsaKey(&genKey, 0); + MakeRsaKey(&genKey, 512, 65537, &rng); + FreeRsaKey(&genKey); + t_fin = clock(); + secs = (double)(t_fin - t_ini) / CLOCKS_PER_SEC; + pc.printf("%.16g\n", secs * 1000.0); + } +} \ No newline at end of file