65816-crypto/sha1test.c

31 lines
792 B
C
Raw Normal View History

#include "sha1.h"
#include <stdio.h>
int main(void) {
struct sha1_context context = {{0}, 0,0,0,0,0, {0}, 0,0,0,0,0,
{0x61,0x62,0x63,0x80,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18
},
{0}};
sha1_init(&context);
sha1_processchunk(&context);
printf("abcde = %08lx %08lx %08lx %08lx %08lx\n", context.a, context.b, context.c, context.d, context.e);
printf("h[..] = %08lx %08lx %08lx %08lx %08lx\n", context.h0, context.h1, context.h2, context.h3, context.h4);
}