diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-11-23 01:05:33 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-11-23 01:05:33 +0100 |
commit | 2f9ae0f8ac8610e13ced184847b57b87fe5db580 (patch) | |
tree | f9ad2223d518585a2cfe9ea1c73e1e37d07bf637 /sys/src/cmd/unix/drawterm/libsec/rsatest.c | |
parent | ea5797c0731203c09ec5fb7172e77eab2750f1a9 (diff) |
removing (outdated) drawterm
drawterm is much better maintained by russ cox,
so removing this outdated copy.
for a more recent version, go to:
http://swtch.com/drawterm/
Diffstat (limited to 'sys/src/cmd/unix/drawterm/libsec/rsatest.c')
-rw-r--r-- | sys/src/cmd/unix/drawterm/libsec/rsatest.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/sys/src/cmd/unix/drawterm/libsec/rsatest.c b/sys/src/cmd/unix/drawterm/libsec/rsatest.c deleted file mode 100644 index 9ff66b5c2..000000000 --- a/sys/src/cmd/unix/drawterm/libsec/rsatest.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "os.h" -#include <mp.h> -#include <libsec.h> -#include <bio.h> - -void -main(void) -{ - RSApriv *rsa; - Biobuf b; - char *p; - int n; - mpint *clr, *enc, *clr2; - uchar buf[4096]; - uchar *e; - vlong start; - - fmtinstall('B', mpconv); - - rsa = rsagen(1024, 16, 0); - if(rsa == nil) - sysfatal("rsagen"); - Binit(&b, 0, OREAD); - clr = mpnew(0); - clr2 = mpnew(0); - enc = mpnew(0); - - strtomp("123456789abcdef123456789abcdef123456789abcdef123456789abcdef", nil, 16, clr); - rsaencrypt(&rsa->pub, clr, enc); - - start = nsec(); - for(n = 0; n < 10; n++) - rsadecrypt(rsa, enc, clr); - print("%lld\n", nsec()-start); - - start = nsec(); - for(n = 0; n < 10; n++) - mpexp(enc, rsa->dk, rsa->pub.n, clr2); - print("%lld\n", nsec()-start); - - if(mpcmp(clr, clr2) != 0) - print("%B != %B\n", clr, clr2); - - print("> "); - while(p = Brdline(&b, '\n')){ - n = Blinelen(&b); - letomp((uchar*)p, n, clr); - print("clr %B\n", clr); - rsaencrypt(&rsa->pub, clr, enc); - print("enc %B\n", enc); - rsadecrypt(rsa, enc, clr); - print("clr %B\n", clr); - n = mptole(clr, buf, sizeof(buf), nil); - write(1, buf, n); - print("> "); - } -} |