pkcs1-test.c 471 Bytes
Newer Older
1
2
#include "testutils.h"

3
4
5
#if WITH_PUBLIC_KEY
# include "pkcs1.h"
#endif
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

int
test_main(void)
{
#if WITH_PUBLIC_KEY
  
  uint8_t buffer[16];
  uint8_t expected[16] = {    1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
			   0xff, 0xff, 0xff, 0xff, 0,    'a',  'b',  'c' };

  pkcs1_signature_prefix(sizeof(buffer), buffer,
			 3, "abc");

  ASSERT(MEMEQ(sizeof(buffer), buffer, expected));

  SUCCESS();
#else /* !WITH_PUBLIC_KEY */
  SKIP();
#endif /* !WITH_PUBLIC_KEY */
}