Skip to content

Commit

Permalink
make DumpPublicKeys write 32-bit values as unsigned
Browse files Browse the repository at this point in the history
Write the 32-bit chunks of N and RR as unsigned, so we get:

  {64,0xc926ad21,{1795090719,2141396315,950055447,2581568430,4268923165,...

instead of:

  {64,0xc926ad21,{1795090719,2141396315,950055447,-1713398866,-26044131,...

Change-Id: I575224fd7f7c34e06a1b6ae976eaa0bef41d2942
  • Loading branch information
Doug Zongker committed Jan 29, 2010
1 parent 2f3d96e commit 5e12d73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libmincrypt/tools/DumpPublicKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static String print(RSAPublicKey key) throws Exception {
// Write out modulus as little endian array of integers.
result.append(",{");
for (int i = 0; i < nwords; ++i) {
int n = N.mod(B).intValue();
long n = N.mod(B).longValue();
result.append(n);

if (i != nwords - 1) {
Expand All @@ -91,7 +91,7 @@ static String print(RSAPublicKey key) throws Exception {
// Write R^2 as little endian array of integers.
result.append(",{");
for (int i = 0; i < nwords; ++i) {
int rr = RR.mod(B).intValue();
long rr = RR.mod(B).longValue();
result.append(rr);

if (i != nwords - 1) {
Expand Down

0 comments on commit 5e12d73

Please sign in to comment.