File: rsa-encrypt-test

package info (click to toggle)
nettle 3.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,508 kB
  • sloc: ansic: 72,410; asm: 21,179; sh: 4,328; makefile: 837; cpp: 71; awk: 7
file content (27 lines) | stat: -rwxr-xr-x 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh

if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
fi

data="$srcdir/nettle-benchmark.c"

if [ -x rsa-encrypt$EXEEXT ] ; then
  if $EMULATOR ./rsa-encrypt$EXEEXT -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then
    :
  else
    exit 1
  fi
  if $EMULATOR ./rsa-decrypt$EXEEXT testkey < testciphertext > testcleartext ; then
    :
  else
    exit 1
  fi
  if cmp "$data" testcleartext ; then
    exit 0
  else
    exit 1
  fi
else
  exit 77
fi