165686Smarkm/*- 2128059Smarkm * Copyright (c) 2000-2004 Mark R V Murray 365686Smarkm * All rights reserved. 465686Smarkm * 565686Smarkm * Redistribution and use in source and binary forms, with or without 665686Smarkm * modification, are permitted provided that the following conditions 765686Smarkm * are met: 865686Smarkm * 1. Redistributions of source code must retain the above copyright 965686Smarkm * notice, this list of conditions and the following disclaimer 1065686Smarkm * in this position and unchanged. 1165686Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1265686Smarkm * notice, this list of conditions and the following disclaimer in the 1365686Smarkm * documentation and/or other materials provided with the distribution. 1465686Smarkm * 1565686Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1665686Smarkm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1765686Smarkm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1865686Smarkm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1965686Smarkm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2065686Smarkm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2165686Smarkm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2265686Smarkm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2365686Smarkm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2465686Smarkm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2565686Smarkm * 2665686Smarkm * $FreeBSD$ 2765686Smarkm */ 2865686Smarkm 29100082Smarkm#define KEYSIZE 32 /* (in bytes) 32 bytes == 256 bits */ 3065686Smarkm 3165686Smarkmstruct yarrowhash { /* Big! Make static! */ 32100082Smarkm SHA256_CTX sha; 3365686Smarkm}; 3465686Smarkm 3565686Smarkmstruct yarrowkey { /* Big! Make static! */ 3674072Smarkm keyInstance key; /* Key schedule */ 3774072Smarkm cipherInstance cipher; /* Rijndael internal */ 3865686Smarkm}; 3965686Smarkm 4074072Smarkmvoid yarrow_hash_init(struct yarrowhash *); 4165686Smarkmvoid yarrow_hash_iterate(struct yarrowhash *, void *, size_t); 4265686Smarkmvoid yarrow_hash_finish(struct yarrowhash *, void *); 4374072Smarkmvoid yarrow_encrypt_init(struct yarrowkey *, void *); 4474072Smarkmvoid yarrow_encrypt(struct yarrowkey *context, void *, void *); 45