Files
2025-02-Numerical/lib/nr/ansi/examples/xpsdes.c
2025-09-12 18:55:25 +09:00

28 lines
549 B
C

/* Driver for routine psdes */
#include <stdio.h>
#define NRANSI
#include "nr.h"
int main(void)
{
static unsigned long lword[5]={0,1,1,99,99};
static unsigned long irword[5]={0,1,99,1,99};
static char *ans[5]={
"",
"0x604d1dce 0x509c0c23",
"0xd97f8571 0xa66cb41a",
"0x7822309d 0x64300984",
"0xd7f376f0 0x59ba89eb"};
int i;
for (i=1;i<=4;i++) {
psdes(&lword[i],&irword[i]);
printf("PSDES now calculates: 0x%x 0x%x\n",lword[i],irword[i]);
printf("Known correct answers are: %s\n",ans[i]);
}
return 0;
}
#undef NRANSI