Print this page
Raise max RSA keysize (WIP)


  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _RSA_IMPL_H
  27 #define _RSA_IMPL_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <sys/types.h>
  34 #include <bignum.h>
  35 
  36 #define MIN_RSA_KEYLENGTH_IN_BYTES      32
  37 #define MAX_RSA_KEYLENGTH_IN_BYTES      512
  38 #define RSA_MIN_KEY_LEN 256     /* RSA min key length in bits */
  39 #define RSA_MAX_KEY_LEN 4096    /* RSA max key length in bits */
  40 
  41 #ifdef _KERNEL
  42 
  43 #include <sys/sunddi.h>
  44 #include <sys/crypto/common.h>
  45 
  46 #define CK_BYTE                 uchar_t
  47 #define CK_ULONG                ulong_t
  48 #define CK_RV                   int
  49 
  50 #define CKR_OK                  CRYPTO_SUCCESS
  51 #define CKR_ARGUMENTS_BAD       CRYPTO_ARGUMENTS_BAD
  52 #define CKR_DATA_LEN_RANGE      CRYPTO_DATA_LEN_RANGE
  53 #define CKR_DEVICE_ERROR        CRYPTO_DEVICE_ERROR
  54 #define CKR_GENERAL_ERROR       CRYPTO_GENERAL_ERROR
  55 #define CKR_HOST_MEMORY         CRYPTO_HOST_MEMORY
  56 #define CKR_KEY_SIZE_RANGE      CRYPTO_KEY_SIZE_RANGE
  57 
  58 int random_get_bytes(uint8_t *ran_out, size_t ran_len);
  59 int random_get_pseudo_bytes(uint8_t *ran_out, size_t ran_len);




  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _RSA_IMPL_H
  27 #define _RSA_IMPL_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <sys/types.h>
  34 #include <bignum.h>
  35 
  36 #define MIN_RSA_KEYLENGTH_IN_BYTES      32
  37 #define MAX_RSA_KEYLENGTH_IN_BYTES      2048
  38 #define RSA_MIN_KEY_LEN 256     /* RSA min key length in bits */
  39 #define RSA_MAX_KEY_LEN 16384   /* RSA max key length in bits */
  40 
  41 #ifdef _KERNEL
  42 
  43 #include <sys/sunddi.h>
  44 #include <sys/crypto/common.h>
  45 
  46 #define CK_BYTE                 uchar_t
  47 #define CK_ULONG                ulong_t
  48 #define CK_RV                   int
  49 
  50 #define CKR_OK                  CRYPTO_SUCCESS
  51 #define CKR_ARGUMENTS_BAD       CRYPTO_ARGUMENTS_BAD
  52 #define CKR_DATA_LEN_RANGE      CRYPTO_DATA_LEN_RANGE
  53 #define CKR_DEVICE_ERROR        CRYPTO_DEVICE_ERROR
  54 #define CKR_GENERAL_ERROR       CRYPTO_GENERAL_ERROR
  55 #define CKR_HOST_MEMORY         CRYPTO_HOST_MEMORY
  56 #define CKR_KEY_SIZE_RANGE      CRYPTO_KEY_SIZE_RANGE
  57 
  58 int random_get_bytes(uint8_t *ran_out, size_t ran_len);
  59 int random_get_pseudo_bytes(uint8_t *ran_out, size_t ran_len);