~ubuntu-branches/ubuntu/utopic/nettle/utopic

« back to all changes in this revision

Viewing changes to testsuite/rsa-test.c

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-05-07 22:57:14 UTC
  • mfrom: (8.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130507225714-s331yr8ov53dtt17
Tags: 2.7-2
Tag some (ECC related) symbols that only exist on some architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "testutils.h"
2
2
 
3
 
int
 
3
void
4
4
test_main(void)
5
5
{
6
6
  struct rsa_public_key pub;
102
102
  
103
103
  mpz_set_str(pub.e, "3f1a012d", 16);
104
104
 
105
 
  if (!rsa_public_key_prepare(&pub))
106
 
    FAIL();
 
105
  ASSERT (rsa_public_key_prepare(&pub));
107
106
  
108
107
  mpz_set_str(key.p,
109
108
              "0b73c990eeda0a2a" "2c26416052c85560" "0c5c0f5ce86a8326"
130
129
              "05e1831619db2f10" "bb9b6a8fd5c95df2" "eb78f303ea0c0cc8"
131
130
              "06", 16);
132
131
 
133
 
  if (!rsa_private_key_prepare(&key))
134
 
    FAIL();
135
 
 
136
 
  if (pub.size != key.size)
137
 
    FAIL();
 
132
  ASSERT (rsa_private_key_prepare(&key));
 
133
  ASSERT (pub.size == key.size);
138
134
 
139
135
  /* Test md5 signatures */
140
136
  mpz_set_str(expected,
177
173
  rsa_private_key_clear(&key);
178
174
  rsa_public_key_clear(&pub);
179
175
  mpz_clear(expected);
180
 
 
181
 
  SUCCESS();
182
176
}