Darren Tucker | 9976246 | 2004-02-06 15:22:43 +1100 | [diff] [blame] | 1 | /* $Id: acss.h,v 1.2 2004/02/06 04:22:43 dtucker Exp $ */ |
Damien Miller | 4f0fe68 | 2004-01-27 21:19:21 +1100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2004 The OpenBSD project |
| 4 | * |
| 5 | * Permission to use, copy, modify, and distribute this software for any |
| 6 | * purpose with or without fee is hereby granted, provided that the above |
| 7 | * copyright notice and this permission notice appear in all copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | */ |
| 17 | |
| 18 | #ifndef _ACSS_H_ |
| 19 | #define _ACSS_H_ |
| 20 | |
| 21 | /* 40bit key */ |
| 22 | #define ACSS_KEYSIZE 5 |
| 23 | |
| 24 | /* modes of acss */ |
| 25 | #define ACSS_AUTHENTICATE 0 |
| 26 | #define ACSS_SESSIONKEY 1 |
| 27 | #define ACSS_TITLEKEY 2 |
| 28 | #define ACSS_DATA 3 |
| 29 | |
| 30 | typedef struct acss_key_st { |
| 31 | unsigned int lfsr17; /* current state of lfsrs */ |
| 32 | unsigned int lfsr25; |
| 33 | unsigned int lfsrsum; |
| 34 | unsigned char seed[ACSS_KEYSIZE]; |
| 35 | unsigned char data[ACSS_KEYSIZE]; |
| 36 | unsigned char subkey[ACSS_KEYSIZE]; |
| 37 | int encrypt; /* XXX make these bit flags? */ |
| 38 | int mode; |
| 39 | int seeded; |
| 40 | int subkey_avilable; |
| 41 | } ACSS_KEY; |
| 42 | |
| 43 | void acss_setkey(ACSS_KEY *, const unsigned char *, int, int); |
| 44 | void acss_setsubkey(ACSS_KEY *, const unsigned char *); |
| 45 | int acss(ACSS_KEY *, unsigned long, const unsigned char *, unsigned char *); |
| 46 | |
| 47 | #endif /* ifndef _ACSS_H_ */ |