/[rdesktop]/sourceforge.net/trunk/rdesktop/crypto/bn_mul.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/crypto/bn_mul.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 194 by matty, Sat Sep 15 09:37:17 2001 UTC revision 195 by matthewc, Wed Sep 25 09:00:57 2002 UTC
# Line 633  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM Line 633  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM
633    
634          if ((al == 0) || (bl == 0))          if ((al == 0) || (bl == 0))
635                  {                  {
636                  BN_zero(r);                  if (!BN_zero(r)) goto err;
637                  return(1);                  return(1);
638                  }                  }
639          top=al+bl;          top=al+bl;
# Line 676  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM Line 676  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM
676                  {                  {
677                  if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA))                  if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA))
678                          {                          {
679                          bn_wexpand(b,al);                          if (bn_wexpand(b,al) == NULL) goto err;
680                          b->d[bl]=0;                          b->d[bl]=0;
681                          bl++;                          bl++;
682                          i--;                          i--;
683                          }                          }
684                  else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA))                  else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA))
685                          {                          {
686                          bn_wexpand(a,bl);                          if (bn_wexpand(a,bl) == NULL) goto err;
687                          a->d[al]=0;                          a->d[al]=0;
688                          al++;                          al++;
689                          i++;                          i++;
# Line 698  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM Line 698  int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM
698                          t = BN_CTX_get(ctx);                          t = BN_CTX_get(ctx);
699                          if (al == j) /* exact multiple */                          if (al == j) /* exact multiple */
700                                  {                                  {
701                                  bn_wexpand(t,k*2);                                  if (bn_wexpand(t,k*2) == NULL) goto err;
702                                  bn_wexpand(rr,k*2);                                  if (bn_wexpand(rr,k*2) == NULL) goto err;
703                                  bn_mul_recursive(rr->d,a->d,b->d,al,t->d);                                  bn_mul_recursive(rr->d,a->d,b->d,al,t->d);
704                                  }                                  }
705                          else                          else
706                                  {                                  {
707                                  bn_wexpand(a,k);                                  if (bn_wexpand(a,k) == NULL ) goto err;
708                                  bn_wexpand(b,k);                                  if (bn_wexpand(b,k) == NULL ) goto err;
709                                  bn_wexpand(t,k*4);                                  if (bn_wexpand(t,k*4) == NULL ) goto err;
710                                  bn_wexpand(rr,k*4);                                  if (bn_wexpand(rr,k*4) == NULL ) goto err;
711                                  for (i=a->top; i<k; i++)                                  for (i=a->top; i<k; i++)
712                                          a->d[i]=0;                                          a->d[i]=0;
713                                  for (i=b->top; i<k; i++)                                  for (i=b->top; i<k; i++)

Legend:
Removed from v.194  
changed lines
  Added in v.195

  ViewVC Help
Powered by ViewVC 1.1.26