yarrow.h revision 62053
162053Smarkm/*- 262053Smarkm * Copyright (c) 2000 Mark Murray 362053Smarkm * All rights reserved. 462053Smarkm * 562053Smarkm * Redistribution and use in source and binary forms, with or without 662053Smarkm * modification, are permitted provided that the following conditions 762053Smarkm * are met: 862053Smarkm * 1. Redistributions of source code must retain the above copyright 962053Smarkm * notice, this list of conditions and the following disclaimer 1062053Smarkm * in this position and unchanged. 1162053Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1262053Smarkm * notice, this list of conditions and the following disclaimer in the 1362053Smarkm * documentation and/or other materials provided with the distribution. 1462053Smarkm * 1562053Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1662053Smarkm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1762053Smarkm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1862053Smarkm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1962053Smarkm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2062053Smarkm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2162053Smarkm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2262053Smarkm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2362053Smarkm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2462053Smarkm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2562053Smarkm * 2662053Smarkm * $FreeBSD: head/sys/dev/random/yarrow.h 62053 2000-06-25 08:38:58Z markm $ 2762053Smarkm */ 2862053Smarkm 2962053Smarkm#define BINS 10 /* t */ 3062053Smarkm#define KEYSIZE 32 /* 32 bytes == 256 bits */ 3162053Smarkm 3262053Smarkm/* This is the beasite that needs protecting. It contains all of the 3362053Smarkm * state that we are excited about. 3462053Smarkm */ 3562053Smarkmstruct state { 3662053Smarkm u_int64_t counter; /* C */ 3762053Smarkm BF_KEY key; /* K */ 3862053Smarkm unsigned char ivec[8]; /* Blowfish internal */ 3962053Smarkm int gengateinterval; /* Pg */ 4062053Smarkm int outputblocks; 4162053Smarkm unsigned char randomstuff[1024]; /* XXX to be done properly */ 4262053Smarkm}; 43