X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/ba6e6b64033b1f9de49feccb5c9cd438354481f7..0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a:/mars.h diff --git a/mars.h b/mars.h deleted file mode 100644 index f32f9f4..0000000 --- a/mars.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*-c-*- - * - * $Id: mars.h,v 1.2 2004/04/08 01:36:15 mdw Exp $ - * - * The MARS block cipher - * - * (c) 2001 Straylight/Edgeware - */ - -/*----- Licensing notice --------------------------------------------------* - * - * This file is part of Catacomb. - * - * Catacomb is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * Catacomb is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with Catacomb; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - */ - -/*----- Notes on the MARS block cipher ------------------------------------* - * - * MARS was IBM's submission to the AES contest. It was designed by a number - * of clever people at the T. J. Watson labs, and made it to the second round - * of the contest. Unfortunately, MARS is rather messy. There are some - * awkward corner cases in the key schedule algorithm, for example, that show - * up very rarely. - */ - -#ifndef CATACOMB_MARS_H -#define CATACOMB_MARS_H - -#ifdef __cplusplus - extern "C" { -#endif - -/*----- Header files ------------------------------------------------------*/ - -#include - -#include - -/*----- Magical numbers ---------------------------------------------------*/ - -#define MARS_BLKSZ 16 -#define MARS_KEYSZ 32 -#define MARS_CLASS (N, L, 128) - -extern const octet mars_keysz[]; - -/*----- Data structures ---------------------------------------------------*/ - -typedef struct mars_ctx { - uint32 k[40]; -} mars_ctx; - -/*----- Functions provided ------------------------------------------------*/ - -/* --- @mars_init@ --- * - * - * Arguments: @mars_ctx *k@ = pointer to key block to fill in - * @const void *buf@ = pointer to buffer of key material - * @size_t sz@ = size of key material - * - * Returns: --- - * - * Use: Initializes a MARS key buffer. MARS accepts key sizes - * between 128 and 448 bits which are a multiple of 32 bits. - */ - -extern void mars_init(mars_ctx */*k*/, - const void */*buf*/, size_t /*sz*/); - -/* --- @mars_eblk@, @mars_dblk@ --- * - * - * Arguments: @const mars_ctx *k@ = pointer to key block - * @const uint32 s[4]@ = pointer to source block - * @uint32 d[4]@ = pointer to destination block - * - * Returns: --- - * - * Use: Low-level block encryption and decryption. - */ - -extern void mars_eblk(const mars_ctx */*k*/, - const uint32 */*s*/, uint32 */*d*/); - -extern void mars_dblk(const mars_ctx */*k*/, - const uint32 */*s*/, uint32 */*d*/); - -/*----- That's all, folks -------------------------------------------------*/ - -#ifdef __cplusplus - } -#endif - -#endif