Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
         BIGNUM kernel module
    1.2. Name of Document Author/Supplier:
         Author:  Ferenc Rakoczi
    1.3  Date of This Document:
        05 February, 2008
4. Technical Description

This case factors out the duplicated (copy/paste) BIGNUM code from the
existing "rsa" and "ncp" Kernel Crypto Provider modules and the userland
pkcs11_softtoken plugin for libpkcs11.  It does so by providing a new
consolidation private kernel/misc/bignum module.

The resulting new binaries are:

        kernel/misc/bignum
        kernel/misc/amd64/bignum
        kernel/misc/sparcv9/bignum
        platform/sun4u/kernel/misc/sparcv9/bignum


Additional $PLATFORM variants of bignum maybe added in the future and adding
one is not expected require an ARC review (even closed-approved automatic).

All interfaces exported from the module are Consolidation Private to ON.
Release binding is patch.

Since these are Consolidation Private no header file is included in SUNWhea.
The header file in the ON consolidation is $SRC/common/bignum/bignum.h

For reference they are:

  extern BIGNUM big_One;
  extern BIGNUM big_Two;
  BIG_ERR_CODE big_init(BIGNUM *number, int size);
  BIG_ERR_CODE big_extend(BIGNUM *number, int size);
  void big_finish(BIGNUM *number);
  void bytestring2bignum(BIGNUM *bn, uchar_t *kn, size_t len);
  void bignum2bytestring(uchar_t *kn, BIGNUM *bn, size_t len);
  BIG_ERR_CODE big_mont_rr(BIGNUM *result, BIGNUM *n);
  BIG_ERR_CODE big_modexp(BIGNUM *result, BIGNUM *a, BIGNUM *e,
      BIGNUM *n, BIGNUM *n_rr);
  BIG_ERR_CODE big_modexp_ext(BIGNUM *result, BIGNUM *a, BIGNUM *e,
      BIGNUM *n, BIGNUM *n_rr, big_modexp_ncp_info_t *info);
  BIG_ERR_CODE big_modexp_crt(BIGNUM *result, BIGNUM *a, BIGNUM *dmodpminus1,
      BIGNUM *dmodqminus1, BIGNUM *p, BIGNUM *q, BIGNUM *pinvmodq,
      BIGNUM *p_rr, BIGNUM *q_rr);
  BIG_ERR_CODE big_modexp_crt_ext(BIGNUM *result, BIGNUM *a,
      BIGNUM *dmodpminus1,
      BIGNUM *dmodqminus1, BIGNUM *p, BIGNUM *q, BIGNUM *pinvmodq,
      BIGNUM *p_rr, BIGNUM *q_rr, big_modexp_ncp_info_t *info);
  int big_cmp_abs(BIGNUM *a, BIGNUM *b);
  BIG_ERR_CODE randombignum(BIGNUM *r, int length);
  BIG_ERR_CODE big_div_pos(BIGNUM *result, BIGNUM *remainder,
      BIGNUM *aa, BIGNUM *bb);
  BIG_ERR_CODE big_ext_gcd_pos(BIGNUM *gcd, BIGNUM *cm, BIGNUM *ce,
      BIGNUM *m, BIGNUM *e);
  BIG_ERR_CODE big_add(BIGNUM *result, BIGNUM *aa, BIGNUM *bb);
  BIG_ERR_CODE big_add_abs(BIGNUM *result, BIGNUM *aa, BIGNUM *bb);
  BIG_ERR_CODE big_mul(BIGNUM *result, BIGNUM *aa, BIGNUM *bb);
  void big_shiftright(BIGNUM *result, BIGNUM *aa, int offs);
  BIG_ERR_CODE big_nextprime_pos(BIGNUM *result, BIGNUM *n);
  BIG_ERR_CODE big_nextprime_pos_ext(BIGNUM *result, BIGNUM *n,
      big_modexp_ncp_info_t *info);
  BIG_ERR_CODE big_sub_pos(BIGNUM *result, BIGNUM *aa, BIGNUM *bb);
  BIG_ERR_CODE big_copy(BIGNUM *dest, BIGNUM *src);
  BIG_ERR_CODE big_sub(BIGNUM *result, BIGNUM *aa, BIGNUM *bb);
  int big_bitlength(BIGNUM *n);
  BIG_ERR_CODE big_init1(BIGNUM *number, int size,
      BIG_CHUNK_TYPE *buf, int bufsize);
  BIG_ERR_CODE big_mont_mul(BIGNUM *ret,
      BIGNUM *a, BIGNUM *b, BIGNUM *n, BIG_CHUNK_TYPE n0);
  int big_is_zero(BIGNUM *n);
  BIG_CHUNK_TYPE big_n0(BIG_CHUNK_TYPE n);




6. Resources and Schedule
    6.4. Steering Committee requested information
        6.4.1. Consolidation C-team Name:
                ON
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open


Reply via email to