[BACK]Return to rc4.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/rc4.h, Revision 1.1

1.1     ! deraadt     1: /*
        !             2:
        !             3: Alleged RC4 (based on the Usenet posting in Spring-95)
        !             4:
        !             5: */
        !             6:
        !             7: /* RCSID("$Id: rc4.h,v 1.2 1999/05/04 11:59:01 bg Exp $"); */
        !             8:
        !             9: #ifndef RC4_H
        !            10: #define RC4_H
        !            11:
        !            12: typedef struct
        !            13: {
        !            14:    unsigned int x;
        !            15:    unsigned int y;
        !            16:    unsigned char state[256];
        !            17: } RC4Context;
        !            18:
        !            19: /* Initializes the context and sets the key. */
        !            20: void rc4_init(RC4Context *ctx, const unsigned char *key, unsigned int keylen);
        !            21:
        !            22: /* Returns the next pseudo-random byte from the RC4 (pseudo-random generator)
        !            23:    stream. */
        !            24: unsigned int rc4_byte(RC4Context *ctx);
        !            25:
        !            26: /* Encrypts data. */
        !            27: void rc4_encrypt(RC4Context *ctx, unsigned char *dest,
        !            28:                 const unsigned char *src, unsigned int len);
        !            29:
        !            30: /* Decrypts data. */
        !            31: void rc4_decrypt(RC4Context *ctx, unsigned char *dest,
        !            32:                 const unsigned char *src, unsigned int len);
        !            33:
        !            34: #endif /* RC4_H */