cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Very Large Integer
Very Large Integer
Nov 5, 2013 at 5:33pm UTC
giblit
(3750)
Would this be the fastest way to add two very large number with a result that is say a 256 byte number? Curious for a RSA-2048 encryption which uses a 256 byte number. Though the RSA encryption is a large prime * a large prime.
1
2
3
4
5
6
while
( rhs.any() ) { carry = ( lhs & rhs ) << 1; lhs ^= rhs; rhs = carry; }
Example of 4 + 4:
0100 + 0100 = ??
round 1:
carry = 1000
lhs = 0000
rhs = 1000
rhs has 0 bits set
answer is now 1000 = 8
*small typo
Last edited on
Nov 5, 2013 at 5:36pm UTC
Topic archived. No new replies allowed.