Compare commits
32 Commits
OpenSSL-fi
...
OpenSSL-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b4f1f302d | ||
|
|
986b927fb3 | ||
|
|
add13802cf | ||
|
|
b6c1d4b7f0 | ||
|
|
933c9d00da | ||
|
|
aaf8b56fc8 | ||
|
|
799602e489 | ||
|
|
82607b291f | ||
|
|
fd9d2eaf16 | ||
|
|
3e1beaf43e | ||
|
|
ea11fc17cf | ||
|
|
05b751c96b | ||
|
|
9fe1f397aa | ||
|
|
be739df6c5 | ||
|
|
d26196803e | ||
|
|
1c540214e0 | ||
|
|
79f0c30e7e | ||
|
|
3d75000cc3 | ||
|
|
b82ac9947e | ||
|
|
23c7979fcf | ||
|
|
88e9264dd2 | ||
|
|
83db979256 | ||
|
|
4feb7ef394 | ||
|
|
4972d50da0 | ||
|
|
35b412322f | ||
|
|
b75ff26d7b | ||
|
|
b440c25d36 | ||
|
|
76f4af202e | ||
|
|
fcb81a191d | ||
|
|
05703abd9f | ||
|
|
455ecb3a06 | ||
|
|
d8e5830423 |
@@ -397,8 +397,6 @@ my %table=(
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
# eCos ARMv4/5
|
||||
"ecos-armv4", "gcc:-D__ECOS__ -I\$(ECOSCFG)/include -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Wno-write-strings -mno-thumb-interwork -mcpu=arm926ej-s -g -O2 -fno-exceptions::-D_REENTRANT::-nostartfiles -L\$(ECOSCFG)/lib -Ttarget.ld::".eval{my $asm=$armv4_asm;$asm=~s/armcap.o//;$asm},
|
||||
|
||||
# Android: linux-* but without -DTERMIO and pointers to headers and libs.
|
||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -465,8 +463,8 @@ my %table=(
|
||||
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
|
||||
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
|
||||
# at build time. $OBJECT_MODE is respected at ./config stage!
|
||||
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
|
||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
|
||||
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
|
||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
|
||||
|
||||
#
|
||||
# Cray T90 and similar (SDSC)
|
||||
|
||||
4
TABLE
4
TABLE
@@ -862,7 +862,7 @@ $multilib =
|
||||
$cc = cc
|
||||
$cflags = -q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
|
||||
$unistd =
|
||||
$thread_cflag = -qthreaded
|
||||
$thread_cflag = -qthreaded -D_THREAD_SAFE
|
||||
$sys_id = AIX
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR
|
||||
@@ -961,7 +961,7 @@ $multilib =
|
||||
$cc = cc
|
||||
$cflags = -q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
|
||||
$unistd =
|
||||
$thread_cflag = -qthreaded
|
||||
$thread_cflag = -qthreaded -D_THREAD_SAFE
|
||||
$sys_id = AIX
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR
|
||||
|
||||
5
config
5
config
@@ -134,10 +134,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "${MACHINE}-dg-dgux"; exit 0
|
||||
;;
|
||||
|
||||
ecos:*)
|
||||
echo "${MACHINE}-whatever-ecos"; exit 0
|
||||
;;
|
||||
|
||||
HI-UX:*)
|
||||
echo "${MACHINE}-hi-hiux"; exit 0
|
||||
;;
|
||||
@@ -649,7 +645,6 @@ case "$GUESSOS" in
|
||||
|
||||
options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||
OUT="linux-generic32" ;;
|
||||
armv[45]*-*-ecos) OUT="ecos-armv4" ;;
|
||||
armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
|
||||
armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;;
|
||||
arm*-*-linux2) OUT="linux-armv4" ;;
|
||||
|
||||
@@ -77,19 +77,17 @@ struct CMAC_CTX_st
|
||||
|
||||
/* Make temporary keys K1 and K2 */
|
||||
|
||||
static void make_kn(unsigned char *k1, unsigned char *l, int bl)
|
||||
static void make_kn(unsigned char *k1, const unsigned char *l, int bl)
|
||||
{
|
||||
int i;
|
||||
unsigned char c = l[0], carry = c>>7, cnext;
|
||||
|
||||
/* Shift block to left, including carry */
|
||||
for (i = 0; i < bl; i++)
|
||||
{
|
||||
k1[i] = l[i] << 1;
|
||||
if (i < bl - 1 && l[i + 1] & 0x80)
|
||||
k1[i] |= 1;
|
||||
}
|
||||
for (i = 0; i < bl-1; i++, c = cnext)
|
||||
k1[i] = (c << 1) | ((cnext=l[i+1]) >> 7);
|
||||
|
||||
/* If MSB set fixup with R */
|
||||
if (l[0] & 0x80)
|
||||
k1[bl - 1] ^= bl == 16 ? 0x87 : 0x1b;
|
||||
k1[i] = (c << 1) ^ ((0-carry)&(bl==16?0x87:0x1b));
|
||||
}
|
||||
|
||||
CMAC_CTX *CMAC_CTX_new(void)
|
||||
@@ -153,6 +151,8 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
|
||||
return 0;
|
||||
if (!M_EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, zero_iv))
|
||||
return 0;
|
||||
memset(ctx->tbl, 0, M_EVP_CIPHER_CTX_block_size(&ctx->cctx));
|
||||
ctx->nlast_block = 0;
|
||||
return 1;
|
||||
}
|
||||
/* Initialiase context */
|
||||
|
||||
@@ -1195,6 +1195,7 @@ static int aes_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
vpaes_set_encrypt_key(key, ctx->key_len*8, &cctx->ks);
|
||||
CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
|
||||
&cctx->ks, (block128_f)vpaes_encrypt);
|
||||
cctx->str = NULL;
|
||||
cctx->key_set = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1403,7 +1403,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
|
||||
void (*gcm_gmult_p)(u64 Xi[2],const u128 Htable[16]) = ctx->gmult;
|
||||
#endif
|
||||
|
||||
if (ctx->mres)
|
||||
if (ctx->mres || ctx->ares)
|
||||
GCM_MUL(ctx,Xi);
|
||||
|
||||
if (is_endian.little) {
|
||||
|
||||
@@ -208,6 +208,8 @@ static void gcmtest(FILE *in, FILE *out, int encrypt)
|
||||
ct = OPENSSL_malloc(ptlen);
|
||||
rv = FIPS_cipher(&ctx, ct, pt, ptlen);
|
||||
}
|
||||
else
|
||||
FIPS_cipher(&ctx, iv, iv, 0);
|
||||
FIPS_cipher(&ctx, NULL, NULL, 0);
|
||||
FIPS_cipher_ctx_ctrl(&ctx, EVP_CTRL_GCM_GET_TAG,
|
||||
taglen, tag);
|
||||
@@ -242,6 +244,8 @@ static void gcmtest(FILE *in, FILE *out, int encrypt)
|
||||
pt = OPENSSL_malloc(ptlen);
|
||||
rv = FIPS_cipher(&ctx, pt, ct, ptlen);
|
||||
}
|
||||
else
|
||||
FIPS_cipher(&ctx, iv, iv, 0);
|
||||
rv = FIPS_cipher(&ctx, NULL, NULL, 0);
|
||||
if (rv < 0)
|
||||
fprintf(out, "FAIL" RESP_EOL);
|
||||
|
||||
@@ -34,11 +34,9 @@ const void *FIPS_text_end(void);
|
||||
defined(__mips__)|| defined(__mips))) || \
|
||||
(defined(__NetBSD__) && (defined(__powerpc__) || defined(__i386))) || \
|
||||
(defined(__linux) && ((defined(__PPC__) && !defined(__PPC64__)) || \
|
||||
defined(__arm__) || defined(__arm)) || \
|
||||
defined(__mips__)) || \
|
||||
defined(__arm__) || defined(__arm))) || \
|
||||
(defined(__APPLE__) /* verified on all MacOS X & iOS flavors */)|| \
|
||||
(defined(_TMS320C6X)) || \
|
||||
(defined(__ECOS__)) || \
|
||||
(defined(_WIN32) && defined(_MSC_VER))
|
||||
# define FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE
|
||||
# endif
|
||||
|
||||
@@ -182,7 +182,7 @@ int main(int argc,char **argv)
|
||||
int r, nid = 0;
|
||||
int pr = 0;
|
||||
char buf[2048], lbuf[2048];
|
||||
unsigned char randout[2048];
|
||||
unsigned char *randout = NULL;
|
||||
char *keyword = NULL, *value = NULL;
|
||||
|
||||
unsigned char *ent = NULL, *nonce = NULL, *pers = NULL, *adin = NULL;
|
||||
@@ -298,6 +298,8 @@ int main(int argc,char **argv)
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
if (!strcmp(keyword, "[ReturnedBitsLen"))
|
||||
randoutlen = atoi(value) / 8;
|
||||
|
||||
if (!strcmp(keyword, "EntropyInput"))
|
||||
{
|
||||
@@ -327,7 +329,11 @@ int main(int argc,char **argv)
|
||||
FIPS_drbg_set_callbacks(dctx, test_entropy, 0, 0,
|
||||
test_nonce, 0);
|
||||
FIPS_drbg_set_app_data(dctx, &t);
|
||||
randoutlen = (int)FIPS_drbg_get_blocklength(dctx);
|
||||
if (randoutlen == 0)
|
||||
randoutlen = (int)FIPS_drbg_get_blocklength(dctx);
|
||||
if (randout)
|
||||
OPENSSL_free(randout);
|
||||
randout = OPENSSL_malloc(randoutlen);
|
||||
r = FIPS_drbg_instantiate(dctx, pers, perslen);
|
||||
if (!r)
|
||||
{
|
||||
@@ -406,6 +412,8 @@ int main(int argc,char **argv)
|
||||
}
|
||||
|
||||
}
|
||||
if (randout)
|
||||
OPENSSL_free(randout);
|
||||
if (in && in != stdin)
|
||||
fclose(in);
|
||||
if (out && out != stdout)
|
||||
|
||||
@@ -208,6 +208,7 @@ int FIPS_cipherinit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
|
||||
break;
|
||||
|
||||
case EVP_CIPH_CTR_MODE:
|
||||
ctx->num = 0;
|
||||
/* Don't reuse IV for CTR mode */
|
||||
if(iv)
|
||||
memcpy(ctx->iv, iv, M_EVP_CIPHER_CTX_iv_length(ctx));
|
||||
|
||||
@@ -127,14 +127,8 @@ elsif ($FLAVOR =~ /CE/)
|
||||
$base_cflags.=" $wcecdefs";
|
||||
$base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
|
||||
$base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
|
||||
if ($ENV{PLATFORM} =~ /wce7/i) {
|
||||
$opt_cflags=' /MT /O1i'; # optimize for space, but with intrinsics...
|
||||
$dbg_cflags=' /MT /Od -DDEBUG -D_DEBUG';
|
||||
} else {
|
||||
$opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
|
||||
$dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG';
|
||||
}
|
||||
|
||||
$opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
|
||||
$dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
|
||||
$lflags="/nologo /opt:ref $wcelflag";
|
||||
}
|
||||
else # Win32
|
||||
|
||||
Reference in New Issue
Block a user