des_int.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* Copyright 1987, 1988, 1990 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* Private include file for the Data Encryption Standard library.
*/
/*
* Copyright (C) 1998 by the FundsXpress, INC.
*
* All rights reserved.
*
* Export of this software from the United States of America may require
* a specific license from the United States Government. It is the
* responsibility of any person or organization contemplating export to
* obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of FundsXpress. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. FundsXpress makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* only do the whole thing once */
#ifndef DES_INTERNAL_DEFS
#define DES_INTERNAL_DEFS
#pragma ident "%Z%%M% %I% %E% SMI"
#include <k5-int.h>
/*
* Begin "mit-des.h"
*/
#ifndef KRB5_MIT_DES__
#define KRB5_MIT_DES__
#if !defined(PROTOTYPE)
#define PROTOTYPE(x) x
#else
#define PROTOTYPE(x) ()
#endif
#endif
#ifndef DES_INT32
#ifdef SIZEOF_INT
#if SIZEOF_INT >= 4
#define DES_INT32 int
#else
#define DES_INT32 long
#endif
#else /* !defined(SIZEOF_INT) */
#include <limits.h>
#if (UINT_MAX >= 0xffffffff)
#define DES_INT32 int
#else
#define DES_INT32 long
#endif
#endif /* !defined(SIZEOF_INT) */
#endif /* !defined(DES_INT32) */
/* Triple-DES structures */
#define MIT_DES_ENCRYPT 1
#define MIT_DES_DECRYPT 0
/* the first byte of the key is already in the keyblock */
/* This used to be 8*sizeof(krb5_octet) */
#define MIT_DES_KEYSIZE 8
/*
* Check if k5-int.h has been included before us. If so, then check to see
* that our view of the DES key size is the same as k5-int.h's.
*/
#ifdef KRB5_MIT_DES_KEYSIZE
#endif /* MIT_DES_KEYSIZE != KRB5_MIT_DES_KEYSIZE */
#endif /* KRB5_MIT_DES_KEYSIZE */
#endif /* KRB5_MIT_DES__ */
/*
* End "mit-des.h"
*/
#ifndef _KERNEL
/* afsstring2key.c */
#endif
/* f_cksum.c */
extern unsigned long mit_des_cbc_cksum
/* f_cbc.c */
extern int mit_des_cbc_encrypt
int encrypt));
/* fin_rndkey.c */
krb5_pointer FAR *));
/* finish_key.c */
/* key_parity.c */
/* process_ky.c */
/* string2key.c */
krb5_keyblock FAR *,
/* weak_key.c */
/* cmb_keys.c */
/* f_pcbc.c */
int mit_des_pcbc_encrypt ();
/* misc.c */
extern unsigned long long_swap_bits PROTOTYPE((unsigned long ));
extern unsigned long swap_six_bits_to_ansi PROTOTYPE((unsigned long ));
extern unsigned long swap_four_bits_to_ansi PROTOTYPE((unsigned long ));
extern unsigned long swap_bit_pos_1 PROTOTYPE((unsigned long ));
extern unsigned long swap_bit_pos_0 PROTOTYPE((unsigned long ));
extern unsigned long swap_bit_pos_0_to_ansi PROTOTYPE((unsigned long ));
extern unsigned long rev_swap_bit_pos_0 PROTOTYPE((unsigned long ));
extern unsigned long swap_byte_bits PROTOTYPE((unsigned long ));
extern unsigned long swap_long_bytes_bit_number PROTOTYPE((unsigned long ));
#ifdef FILE
/* XXX depends on FILE being a #define! */
#endif
/* d3_cbc.c */
extern int mit_des3_cbc_encrypt
long length,
int encrypt));
/* d3_procky.c */
const krb5_keyblock * keyblock));
/* d3_str2ky.c */
krb5_keyblock FAR *,
/* u_nfold.c */
extern krb5_error_code mit_des_n_fold
krb5_octet * output,
#endif /*DES_INTERNAL_DEFS*/