remove BN_ncopy, it was only used in bn_nist.c and wasn't particular
authorNils Larsch <nils@openssl.org>
Tue, 3 May 2005 20:27:00 +0000 (20:27 +0000)
committerNils Larsch <nils@openssl.org>
Tue, 3 May 2005 20:27:00 +0000 (20:27 +0000)
useful anyway

crypto/bn/bn.h
crypto/bn/bn_lib.c

index d118fc6a8012f6b5db078368afc377fd523215dd..cd03dae77e45194554c489be3f74270092f401e1 100644 (file)
@@ -390,8 +390,6 @@ BIGNUM *BN_new(void);
 void   BN_init(BIGNUM *);
 void   BN_clear_free(BIGNUM *a);
 BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
-/* BN_ncopy(): like BN_copy() but copies at most the first n BN_ULONGs */
-BIGNUM *BN_ncopy(BIGNUM *a, const BIGNUM *b, size_t n);
 void   BN_swap(BIGNUM *a, BIGNUM *b);
 BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret);
 int    BN_bn2bin(const BIGNUM *a, unsigned char *to);
index 05d35982e599a88a3846d73e729dacb68da6dc25..3c4d5459f61f5a523d47e2b69d0c12186f63e244 100644 (file)
@@ -531,46 +531,6 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
        return(a);
        }
 
-BIGNUM *BN_ncopy(BIGNUM *a, const BIGNUM *b, size_t n)
-       {
-       int i, min;
-       BN_ULONG *A;
-       const BN_ULONG *B;
-
-       bn_check_top(b);
-       if (a == b)
-               return a;
-
-       min = (b->top < (int)n)? b->top: (int)n;
-       if (!min)
-               {
-               BN_zero(a);
-               return a;
-               }
-       if (bn_wexpand(a, min) == NULL)
-               return NULL;
-
-       A=a->d;
-       B=b->d;
-       for (i=min>>2; i>0; i--, A+=4, B+=4)
-               {
-               BN_ULONG a0,a1,a2,a3;
-               a0=B[0]; a1=B[1]; a2=B[2]; a3=B[3];
-               A[0]=a0; A[1]=a1; A[2]=a2; A[3]=a3;
-               }
-       switch (min&3)
-               {
-               case 3: A[2]=B[2];
-               case 2: A[1]=B[1];
-               case 1: A[0]=B[0];
-               case 0: ;
-               }
-       a->top = min;
-       a->neg = b->neg;
-       bn_correct_top(a);
-       return(a);
-       }
-
 void BN_swap(BIGNUM *a, BIGNUM *b)
        {
        int flags_old_a, flags_old_b;