/* $Id$ */ /* * Copyright (C) 1998-2002 RSA Security Inc. All rights reserved. * * This work contains proprietary information of RSA Security. * Distribution is limited to authorized licensees of RSA * Security. Any unauthorized reproduction, distribution or * modification of this work is strictly prohibited. * */ #include "bn_lcl.h" /* rp has w words, the top w words are 0 */ void bn_from_montgomery_words(ret,a,np,w,n0) BN_ULONG *ret; BN_ULONG *a; BN_ULONG *np; int w; BN_ULONG n0; { BN_ULONG v0,v1,*ap,*wap; int i; v1=0; ap=a; wap= &(a[w]); /* Consider putting this loop in ASM */ for (i=0; i0; i--) if (ap[i] != np[i]) break; } v1=(ap[i] >= np[i]); } if (v1) (void)bn_sub_words(ret,ap,np,w); else { #if 0 /* Alpha does not like Memcpy */ Memcpy(ret,ap,sizeof(BN_ULONG)*w); #else for (i=0; i