Rank: 164125 based on 0 downloads (last 30 days) and 0 file submitted
photo

Nanthini

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Nanthini View all
Updated File Comments Rating
02 Dec 2011 Variable Precision Integer Arithmetic Arithmetic with integers of fully arbitrary size. Arrays and vectors of vpi numbers are supported. Author: John D'Errico

hi john,
i want to call a function recursively.. in that vpi numbers are involved...while executing that function code i got following error please suggest me some idea to overcome this problem....thanks in advance....

My code is
n=vpi('59623408128589294906667477489466511394227058875719821124229053681229189216330915080633066080885115044018179752252075074762255857650359062592367314714255870395157878516147169752676083317321479715959914788386131373552660119411485042306204724685302709882300932537368996737625591854420932024858921774454130558350942691706925108621964426007163860852250193402906989838459886518533364378045747452657637521597746398695785988555098978535368265198866036728222641091714452140558062069296423468874123503682189797544270604765655771');
m=vpi(2);
r=vpi(1);
c(1)=mod(power(m,r),n);
t(1)=c(1);
for i=1:l
c(i+1)=vpi(c(i)).*vpi(c(i));
if lt(c(i+1),n)==1
t(i+1)=mod(c(i+1),n);
else
t(i+1)=c(i+1);
end
disp(t(i+1));
end

The output and error is:
2

4

16

256

65536

4.2950e+009

??? Error using ==> vpi.vpi at 141
If N is a double, it may be no larger than 2^53 - 1

Error in ==> vpi.lt at 46
INT1 = vpi(INT1);

Error in ==> mdxp at 19
if lt(c(i+1),n)==1

16 Nov 2011 Variable Precision Integer Arithmetic Arithmetic with integers of fully arbitrary size. Arrays and vectors of vpi numbers are supported. Author: John D'Errico

Thanks john...ya you are right here after i will go through the helps as much as i can...

16 Nov 2011 Variable Precision Integer Arithmetic Arithmetic with integers of fully arbitrary size. Arrays and vectors of vpi numbers are supported. Author: John D'Errico

Hi john,
Is there any possibility to find the length of vpi number???
For example n=vpi('59623408128589294906667477489466511394227058875719821124229053681229189216330915080633066080885115044018179752252075074762255857650359062592367314714255870395157878516147169752676083317321479715959914788386131373552660119411485042306204724685302709882300932537368996737625591854420932024858921774454130558350942691706925108621964426007163860852250193402906989838459886518533364378045747452657637521597746398695785988555098978535368265198866036728222641091714452140558062069296423468874123503682189797544270604765655771')
if suppose,i give length(n) it shows ans as 1...please suggest me some idea...

08 Nov 2011 Variable Precision Integer Arithmetic Arithmetic with integers of fully arbitrary size. Arrays and vectors of vpi numbers are supported. Author: John D'Errico

I am using powermod function to get the result,to compute mod(M^E,N)where M,E,N should be vpi number right???but for M,i am converting char into ASCII value for example 'hai' is my input after converting to ASCII and also append padding bits it become like this 104097105000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
If i pass this number into powermod function where N=vpi('59623408128589294906667477489466511394227058875719821124229053681229189216330915080633066080885115044018179752252075074762255857650359062592367314714255870395157878516147169752676083317321479715959914788386131373552660119411485042306204724685302709882300932537368996737625591854420932024858921774454130558350942691706925108621964426007163860852250193402906989838459886518533364378045747452657637521597746398695785988555098978535368265198866036728222641091714452140558062069296423468874123503682189797544270604765655771');
E=vpi('877598789786798798477798374982794987349');
then i got following error
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> vpi.powermod at 56
a2 = mod(a*a,n);

Error in ==> encryption at 13
c=powermod(m,e,n);

I hope the problem here is i have not converted ASCII value into vpi number
How to resolve this error suggest me some ideas.thanks john

10 Oct 2011 modinv(x, N) Computes multiplicative inverse of x modulo N Author: Steven Gregory

thanks Steven...i got it...

Contact us