OpenCores
URL https://opencores.org/ocsvn/csa/csa/trunk

Subversion Repositories csa

[/] [csa/] [trunk/] [sw_sim/] [stream_cypher.c] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 simon111
 
2
 
3
 
4
/*  this file simulate the stream cypher function */
5
#include <stdlib.h>
6
#include <stdio.h>
7
#include <memory.h>
8
#include "misc.h"
9
extern void stream_cypher(int init, unsigned char *CK, unsigned char *sb, unsigned char *cb);
10
int main()
11
{
12
        unsigned char ck[8];
13
        unsigned char sb[8];
14
        unsigned char sb1[8];
15
        unsigned char cb[8];
16
        READ_DATA(ck, 8*8);
17
        READ_DATA(sb, 8*8);
18
        READ_DATA(sb1,8*8);
19
        stream_cypher(1,ck,sb,cb);
20
        WRITE_DATA(cb,8*8);
21
        stream_cypher(0,ck,sb1,cb);
22
        WRITE_DATA(cb,8*8);
23
 
24
        return 0;
25
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.