Print this page
first pass
*** 53,64 ****
#if defined(__i386) || defined(__amd64)
#include <sys/byteorder.h>
#define UNALIGNED_POINTERS_PERMITTED
#endif
- /* EXPORT DELETE START */
-
/*
* Blowfish initial P box and S boxes, derived from the hex digits of PI.
*
* NOTE: S boxes are placed into one large array.
*/
--- 53,62 ----
*** 365,386 ****
(right) ^= F((left)); \
tmp = (left); \
(left) = (right); \
(right) = tmp;
- /* EXPORT DELETE END */
-
/*
* Encrypt a block of data. Because of addition operations, convert blocks
* to their big-endian representation, even on Intel boxen.
*/
/* ARGSUSED */
int
blowfish_encrypt_block(const void *cookie, const uint8_t *block,
uint8_t *out_block)
{
- /* EXPORT DELETE START */
keysched_t *ksch = (keysched_t *)cookie;
uint32_t left, right, tmp;
uint32_t *P = ksch->ksch_P;
uint32_t *S = ksch->ksch_S;
--- 363,381 ----
*** 458,468 ****
out_block[5] = right >> 16;
out_block[6] = right >> 8;
out_block[7] = right;
#endif /* UNALIGNED_POINTERS_PERMITTED */
}
- /* EXPORT DELETE END */
return (CRYPTO_SUCCESS);
}
/*
* Decrypt a block of data. Because of addition operations, convert blocks
--- 453,462 ----
*** 473,483 ****
/* ARGSUSED */
int
blowfish_decrypt_block(const void *cookie, const uint8_t *block,
uint8_t *out_block)
{
- /* EXPORT DELETE START */
keysched_t *ksch = (keysched_t *)cookie;
uint32_t left, right, tmp;
uint32_t *P = ksch->ksch_P;
uint32_t *S = ksch->ksch_S;
--- 467,476 ----
*** 555,573 ****
out_block[5] = right >> 16;
out_block[6] = right >> 8;
out_block[7] = right;
#endif /* UNALIGNED_POINTERS_PERMITTED */
}
- /* EXPORT DELETE END */
return (CRYPTO_SUCCESS);
}
static void
bitrepeat(uint8_t *pattern, uint_t len_bytes, uint_t len_bits, uint8_t *dst,
uint_t dst_len_bytes)
{
- /* EXPORT DELETE START */
uint8_t *current = dst;
uint_t bitsleft = CRYPTO_BYTES2BITS(dst_len_bytes);
uint_t bitoffset = 0;
uint_t currentbits;
int i;
--- 548,564 ----
*** 615,634 ****
}
}
bitsleft = 0;
}
}
- /* EXPORT DELETE END */
}
/*
* Initialize key schedules for Blowfish.
*/
void
blowfish_init_keysched(uint8_t *key, uint_t bits, void *keysched)
{
- /* EXPORT DELETE START */
keysched_t *newbie = keysched;
uint32_t *P = newbie->ksch_P;
uint32_t *S = newbie->ksch_S;
uint32_t *initp;
uint32_t tmpblock[] = {0, 0};
--- 606,623 ----
*** 683,703 ****
(void) blowfish_encrypt_block(newbie, (uint8_t *)tmpblock,
(uint8_t *)tmpblock);
*initp++ = ntohl(tmpblock[0]);
*initp++ = ntohl(tmpblock[1]);
}
- /* EXPORT DELETE END */
}
/*
* Allocate key schedule for Blowfish.
*/
/* ARGSUSED */
void *
blowfish_alloc_keysched(size_t *size, int kmflag)
{
- /* EXPORT DELETE START */
keysched_t *keysched;
#ifdef _KERNEL
keysched = (keysched_t *)kmem_alloc(sizeof (keysched_t), kmflag);
#else
--- 672,690 ----
*** 705,715 ****
#endif /* _KERNEL */
if (keysched != NULL) {
*size = sizeof (keysched_t);
return (keysched);
}
- /* EXPORT DELETE END */
return (NULL);
}
void
--- 692,701 ----