Print this page
first pass

*** 40,50 **** #include <stdlib.h> #include <thread.h> #include <pthread.h> #include <sys/types.h> - /* EXPORT DELETE START */ /* * This program implements the * Proposed Federal Information Processing * Data Encryption Standard. * See Federal Register, March 17, 1975 (40FR12134) --- 40,49 ----
*** 152,168 **** * Set up the key schedule from the key. */ static mutex_t lock = DEFAULTMUTEX; - /* EXPORT DELETE END */ - - static void des_setkey_nolock(const char *key) { - /* EXPORT DELETE START */ int i, j, k; char t; /* * First, generate C and D by permuting --- 151,163 ----
*** 202,225 **** } } for (i = 0; i < 48; i++) E[i] = e2[i]; - /* EXPORT DELETE END */ } void des_setkey(const char *key) { - /* EXPORT DELETE START */ (void) mutex_lock(&lock); des_setkey_nolock(key); (void) mutex_unlock(&lock); - /* EXPORT DELETE END */ } - /* EXPORT DELETE START */ /* * The 8 selection functions. * For some reason, they give a 0-origin * index, unlike everything else. */ --- 197,216 ----
*** 293,327 **** static char preS[48]; /* * The payoff: encrypt a block. */ - /* EXPORT DELETE END */ static void des_encrypt_nolock(char *block, int edflag) { - /* EXPORT DELETE START */ - if (edflag) (void) _des_decrypt1(block, L, IP, &L[32], preS, E, KS, S, f, tempL, P, FP); else (void) des_encrypt1(block, L, IP, &L[32], preS, E, KS, S, f, tempL, P, FP); - - /* EXPORT DELETE END */ } void des_encrypt(char *block, int edflag) { - /* EXPORT DELETE START */ (void) mutex_lock(&lock); des_encrypt_nolock(block, edflag); (void) mutex_unlock(&lock); - /* EXPORT DELETE END */ } #define IOBUF_SIZE 16 --- 284,311 ----
*** 345,355 **** } char * des_crypt(const char *pw, const char *salt) { - /* EXPORT DELETE START */ int i, j; char c, temp; char block[66]; static thread_key_t key = THR_ONCE_KEY; char *iobuf = _get_iobuf(&key, IOBUF_SIZE); --- 329,338 ----
*** 404,415 **** iobuf[i+2] = 0; if (iobuf[1] == 0) iobuf[1] = iobuf[0]; (void) mutex_unlock(&lock); return (iobuf); - #if 0 - /* EXPORT DELETE END */ - return (0); - /* EXPORT DELETE START */ - #endif - /* EXPORT DELETE END */ } --- 387,392 ----