Print this page
6799218 RSA using Solaris Kernel Crypto framework lagging behind OpenSSL
5016936 bignumimpl:big_mul: potential memory leak
6810280 panic from bignum module: vmem_xalloc(): size == 0

*** 17,60 **** * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* ! * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _BIGNUM_H #define _BIGNUM_H - #pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif #include <sys/types.h> ! #ifndef __sparcv9 ! #define BIGNUM_CHUNK_32 ! #else #ifndef UMUL64 ! #define UMUL64 #endif #endif #define BITSINBYTE 8 #ifdef BIGNUM_CHUNK_32 #define BIG_CHUNK_SIZE 32 #define BIG_CHUNK_TYPE uint32_t #define BIG_CHUNK_TYPE_SIGNED int32_t #define BIG_CHUNK_HIGHBIT 0x80000000 #define BIG_CHUNK_ALLBITS 0xffffffff #define BIG_CHUNK_LOWHALFBITS 0xffff #define BIG_CHUNK_HALF_HIGHBIT 0x8000 #else #define BIG_CHUNK_SIZE 64 #define BIG_CHUNK_TYPE uint64_t #define BIG_CHUNK_TYPE_SIGNED int64_t #define BIG_CHUNK_HIGHBIT 0x8000000000000000ULL --- 17,60 ---- * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* ! * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _BIGNUM_H #define _BIGNUM_H #ifdef __cplusplus extern "C" { #endif #include <sys/types.h> ! #if defined(__sparcv9) || defined(__amd64) /* 64-bit chunk size */ #ifndef UMUL64 ! #define UMUL64 /* 64-bit multiplication results are supported */ #endif + #else + #define BIGNUM_CHUNK_32 #endif #define BITSINBYTE 8 + /* Bignum "digits" (aka "chunks" or "words") are either 32- or 64-bits */ #ifdef BIGNUM_CHUNK_32 #define BIG_CHUNK_SIZE 32 #define BIG_CHUNK_TYPE uint32_t #define BIG_CHUNK_TYPE_SIGNED int32_t #define BIG_CHUNK_HIGHBIT 0x80000000 #define BIG_CHUNK_ALLBITS 0xffffffff #define BIG_CHUNK_LOWHALFBITS 0xffff #define BIG_CHUNK_HALF_HIGHBIT 0x8000 + #else #define BIG_CHUNK_SIZE 64 #define BIG_CHUNK_TYPE uint64_t #define BIG_CHUNK_TYPE_SIGNED int64_t #define BIG_CHUNK_HIGHBIT 0x8000000000000000ULL
*** 76,89 **** * 0 should be represented by size>=1, size>=len>=1, sign=1, * value[i]=0 for 0<i<len */ typedef struct { /* size and len in units of BIG_CHUNK_TYPE words */ ! int size; /* size of memory allocated for value */ ! int len; /* number of words that hold valid data in value */ int sign; /* 1 for nonnegative, -1 for negative */ ! int malloced; /* 1 if value was malloced 0 if not */ BIG_CHUNK_TYPE *value; } BIGNUM; #define BIGTMPSIZE 65 --- 76,89 ---- * 0 should be represented by size>=1, size>=len>=1, sign=1, * value[i]=0 for 0<i<len */ typedef struct { /* size and len in units of BIG_CHUNK_TYPE words */ ! uint32_t size; /* size of memory allocated for value */ ! uint32_t len; /* number of valid data words in value */ int sign; /* 1 for nonnegative, -1 for negative */ ! int malloced; /* 1 if value was malloced, 0 if not */ BIG_CHUNK_TYPE *value; } BIGNUM; #define BIGTMPSIZE 65