mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
des-prototypes-20090315
LICENSE IPL10 FIXES 124230 prototype the des directory
This commit is contained in:
parent
0c39a855a2
commit
c560efe73f
@ -119,13 +119,6 @@ RCSID
|
||||
#ifndef STATIC
|
||||
#define STATIC static
|
||||
#endif
|
||||
STATIC void init_des();
|
||||
STATIC void permute();
|
||||
STATIC void init_perm();
|
||||
|
||||
STATIC int des_setkey(const char *key);
|
||||
STATIC int des_cipher(const char *in, char *out, long salt, int num_iter);
|
||||
|
||||
#ifdef CRYPT_DEBUG
|
||||
STATIC prtab();
|
||||
#endif
|
||||
@ -314,11 +307,7 @@ typedef union {
|
||||
{ C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }
|
||||
|
||||
STATIC void
|
||||
permute(cp, out, p, chars_in)
|
||||
unsigned char *cp;
|
||||
C_block *out;
|
||||
register C_block *p;
|
||||
int chars_in;
|
||||
permute(unsigned char *cp, C_block *out, register C_block *p, int chars_in)
|
||||
{
|
||||
register DCL_BLOCK(D, D0, D1);
|
||||
register C_block *tp;
|
||||
@ -338,6 +327,13 @@ permute(cp, out, p, chars_in)
|
||||
}
|
||||
#endif /* LARGEDATA */
|
||||
|
||||
STATIC void init_des(void);
|
||||
STATIC void init_perm(C_block [64 / CHUNKBITS][1 << CHUNKBITS],
|
||||
unsigned char [64], int, int);
|
||||
STATIC int des_setkey(const char *key);
|
||||
STATIC int des_cipher(const char *in, char *out, long salt, int num_iter);
|
||||
|
||||
|
||||
|
||||
/* ===== (mostly) Standard DES Tables ==================== */
|
||||
|
||||
@ -496,9 +492,7 @@ static char cryptresult[1 + 4 + 4 + 11 + 1]; /* encrypted result */
|
||||
* followed by an encryption produced by the "key" and "setting".
|
||||
*/
|
||||
char *
|
||||
crypt(key, setting)
|
||||
register const char *key;
|
||||
register const char *setting;
|
||||
crypt(register const char *key, register const char *setting)
|
||||
{
|
||||
register char *encp;
|
||||
register long i;
|
||||
@ -611,8 +605,7 @@ static C_block KS[KS_SIZE];
|
||||
* Set up the key schedule from the key.
|
||||
*/
|
||||
STATIC int
|
||||
des_setkey(key)
|
||||
register const char *key;
|
||||
des_setkey(register const char *key)
|
||||
{
|
||||
register DCL_BLOCK(K, K0, K1);
|
||||
register C_block *ptabp;
|
||||
@ -646,11 +639,7 @@ des_setkey(key)
|
||||
* compiler and machine architecture.
|
||||
*/
|
||||
STATIC int
|
||||
des_cipher(in, out, salt, num_iter)
|
||||
const char *in;
|
||||
char *out;
|
||||
long salt;
|
||||
int num_iter;
|
||||
des_cipher(const char *in, char *out, long salt, int num_iter)
|
||||
{
|
||||
/* variables that we want in registers, most important first */
|
||||
#if defined(pdp11)
|
||||
@ -779,7 +768,7 @@ des_cipher(in, out, salt, num_iter)
|
||||
* done at compile time, if the compiler were capable of that sort of thing.
|
||||
*/
|
||||
STATIC void
|
||||
init_des()
|
||||
init_des(void)
|
||||
{
|
||||
register int i, j;
|
||||
register long k;
|
||||
@ -920,10 +909,8 @@ init_des()
|
||||
* "perm" must be all-zeroes on entry to this routine.
|
||||
*/
|
||||
STATIC void
|
||||
init_perm(perm, p, chars_in, chars_out)
|
||||
C_block perm[64 / CHUNKBITS][1 << CHUNKBITS];
|
||||
unsigned char p[64];
|
||||
int chars_in, chars_out;
|
||||
init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
|
||||
unsigned char p[64], int chars_in, int chars_out)
|
||||
{
|
||||
register int i, j, k, l;
|
||||
|
||||
@ -998,10 +985,7 @@ encrypt(block, flag)
|
||||
|
||||
#ifdef CRYPT_DEBUG
|
||||
STATIC
|
||||
prtab(s, t, num_rows)
|
||||
char *s;
|
||||
unsigned char *t;
|
||||
int num_rows;
|
||||
prtab(char *s, unsigned char *t, int num_rows)
|
||||
{
|
||||
register int i, j;
|
||||
|
||||
|
@ -77,6 +77,6 @@ extern void des_set_random_generator_seed(des_cblock key);
|
||||
|
||||
/* read_pssword.c */
|
||||
extern int des_read_password(des_cblock * k, char *prompt, int verify);
|
||||
|
||||
extern int des_read_pw_string(char *, int, char *, int);
|
||||
|
||||
#endif
|
||||
|
@ -44,7 +44,7 @@ RCSID
|
||||
typedef char key[64];
|
||||
|
||||
/* the following are really void but cc86 doesnt allow it */
|
||||
static int make_key_sched();
|
||||
static int make_key_sched(key Key, des_key_schedule Schedule);
|
||||
|
||||
#ifdef AFS_DUX40_ENV
|
||||
#pragma weak des_key_sched = afs_des_key_sched
|
||||
|
@ -17,8 +17,7 @@ RCSID
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
gen(stream)
|
||||
FILE *stream;
|
||||
gen(FILE *stream)
|
||||
{
|
||||
/*
|
||||
* map a byte into its equivalent with odd parity, where odd
|
||||
|
@ -86,8 +86,7 @@ static sigtype sig_restore();
|
||||
static push_signals(), pop_signals();
|
||||
#endif
|
||||
|
||||
int des_read_pw_string(char *, int, char *, int);
|
||||
void des_string_to_key(char *, des_cblock *);
|
||||
#include "des_prototypes.h"
|
||||
|
||||
/*** Routines ****************************************************** */
|
||||
int
|
||||
@ -128,11 +127,7 @@ static void catch(int);
|
||||
* Returns 0 on success, non-zero on failure.
|
||||
*/
|
||||
int
|
||||
des_read_pw_string(s, maxa, prompt, verify)
|
||||
char *s;
|
||||
int maxa;
|
||||
char *prompt;
|
||||
int verify;
|
||||
des_read_pw_string(char *s, int maxa, char *prompt, int verify)
|
||||
{
|
||||
int ok = 0, cnt1 = 0;
|
||||
char *ptr;
|
||||
|
@ -70,8 +70,8 @@ struct rxkad_global_stats {
|
||||
extern pthread_mutex_t rxkad_global_stats_lock;
|
||||
extern pthread_key_t rxkad_stats_key;
|
||||
|
||||
extern void rxkad_global_stats_init();
|
||||
extern rxkad_stats_t * rxkad_thr_stats_init();
|
||||
extern void rxkad_global_stats_init(void);
|
||||
extern rxkad_stats_t * rxkad_thr_stats_init(void);
|
||||
extern int rxkad_stats_agg(rxkad_stats_t *);
|
||||
|
||||
#ifndef BEGIN
|
||||
|
@ -119,6 +119,6 @@ des_string_to_key(char *str, register des_cblock * key)
|
||||
des_fixup_key_parity(key);
|
||||
|
||||
if (des_debug)
|
||||
fprintf(stdout, "\nResulting string_to_key = 0x%lx 0x%lx\n",
|
||||
fprintf(stdout, "\nResulting string_to_key = 0x%x 0x%x\n",
|
||||
*((afs_uint32 *) key), *((afs_uint32 *) key + 1));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user