Print this page
Raise max RSA keysize (WIP)


  69                                 ((((x) - 1) / sizeof (BIG_CHUNK_TYPE)) + 1) : 0)
  70 
  71 #define BIGNUM_WORDSIZE (BIG_CHUNK_SIZE / BITSINBYTE)  /* word size in bytes */
  72 #define BIG_CHUNKS_FOR_160BITS  BITLEN2BIGNUMLEN(160)
  73 
  74 
  75 /*
  76  * leading 0's are permitted
  77  * 0 should be represented by size>=1, size>=len>=1, sign=1,
  78  * value[i]=0 for 0<i<len
  79  */
  80 typedef struct {
  81         /* size and len in units of BIG_CHUNK_TYPE words  */
  82         uint32_t        size;   /* size of memory allocated for value  */
  83         uint32_t        len;    /* number of valid data words in value */
  84         int             sign;   /* 1 for nonnegative, -1 for negative  */
  85         int             malloced; /* 1 if value was malloced, 0 if not */
  86         BIG_CHUNK_TYPE *value;
  87 } BIGNUM;
  88 
  89 #define BIGTMPSIZE 65
  90 
  91 #define BIG_TRUE 1
  92 #define BIG_FALSE 0
  93 
  94 typedef int BIG_ERR_CODE;
  95 
  96 /* error codes */
  97 #define BIG_OK 0
  98 #define BIG_NO_MEM -1
  99 #define BIG_INVALID_ARGS -2
 100 #define BIG_DIV_BY_0 -3
 101 #define BIG_NO_RANDOM -4
 102 #define BIG_GENERAL_ERR -5
 103 #define BIG_TEST_FAILED -6
 104 #define BIG_BUFFER_TOO_SMALL -7
 105 
 106 
 107 #define arraysize(x) (sizeof (x) / sizeof (x[0]))
 108 
 109 typedef BIG_ERR_CODE (*big_modexp_ncp_func_ptr)(BIGNUM *result,




  69                                 ((((x) - 1) / sizeof (BIG_CHUNK_TYPE)) + 1) : 0)
  70 
  71 #define BIGNUM_WORDSIZE (BIG_CHUNK_SIZE / BITSINBYTE)  /* word size in bytes */
  72 #define BIG_CHUNKS_FOR_160BITS  BITLEN2BIGNUMLEN(160)
  73 
  74 
  75 /*
  76  * leading 0's are permitted
  77  * 0 should be represented by size>=1, size>=len>=1, sign=1,
  78  * value[i]=0 for 0<i<len
  79  */
  80 typedef struct {
  81         /* size and len in units of BIG_CHUNK_TYPE words  */
  82         uint32_t        size;   /* size of memory allocated for value  */
  83         uint32_t        len;    /* number of valid data words in value */
  84         int             sign;   /* 1 for nonnegative, -1 for negative  */
  85         int             malloced; /* 1 if value was malloced, 0 if not */
  86         BIG_CHUNK_TYPE *value;
  87 } BIGNUM;
  88 
  89 #define BIGTMPSIZE 257
  90 
  91 #define BIG_TRUE 1
  92 #define BIG_FALSE 0
  93 
  94 typedef int BIG_ERR_CODE;
  95 
  96 /* error codes */
  97 #define BIG_OK 0
  98 #define BIG_NO_MEM -1
  99 #define BIG_INVALID_ARGS -2
 100 #define BIG_DIV_BY_0 -3
 101 #define BIG_NO_RANDOM -4
 102 #define BIG_GENERAL_ERR -5
 103 #define BIG_TEST_FAILED -6
 104 #define BIG_BUFFER_TOO_SMALL -7
 105 
 106 
 107 #define arraysize(x) (sizeof (x) / sizeof (x[0]))
 108 
 109 typedef BIG_ERR_CODE (*big_modexp_ncp_func_ptr)(BIGNUM *result,