Fossil SCM
Bug fix in the sha3sum() routine. Also comment-out that routine since it is not used anyplace in the code.
Commit
6419592d659a2194d63df5f7cfec0e8c511ed1c99ad9b039ff10704f6172a0aa
Parent
f423b10f7930e77…
1 file changed
+3
-1
+3
-1
| --- src/sha3.c | ||
| +++ src/sha3.c | ||
| @@ -600,10 +600,11 @@ | ||
| 600 | 600 | blob_resize(pCksum, iSize/4); |
| 601 | 601 | DigestToBase16(SHA3Final(&ctx), blob_buffer(pCksum), iSize/8); |
| 602 | 602 | return 0; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | +#if 0 /* NOT USED */ | |
| 605 | 606 | /* |
| 606 | 607 | ** Compute the SHA3 checksum of a zero-terminated string. The |
| 607 | 608 | ** result is held in memory obtained from mprintf(). |
| 608 | 609 | */ |
| 609 | 610 | char *sha3sum(const char *zIn, int iSize){ |
| @@ -610,13 +611,14 @@ | ||
| 610 | 611 | SHA3Context ctx; |
| 611 | 612 | char zDigest[132]; |
| 612 | 613 | |
| 613 | 614 | SHA3Init(&ctx, iSize); |
| 614 | 615 | SHA3Update(&ctx, (unsigned const char*)zIn, strlen(zIn)); |
| 615 | - DigestToBase16(SHA3Final(&ctx), zDigest, iSize/4); | |
| 616 | + DigestToBase16(SHA3Final(&ctx), zDigest, iSize/8); | |
| 616 | 617 | return mprintf("%s", zDigest); |
| 617 | 618 | } |
| 619 | +#endif | |
| 618 | 620 | |
| 619 | 621 | /* |
| 620 | 622 | ** COMMAND: sha3sum* |
| 621 | 623 | ** |
| 622 | 624 | ** Usage: %fossil sha3sum FILE... |
| 623 | 625 |
| --- src/sha3.c | |
| +++ src/sha3.c | |
| @@ -600,10 +600,11 @@ | |
| 600 | blob_resize(pCksum, iSize/4); |
| 601 | DigestToBase16(SHA3Final(&ctx), blob_buffer(pCksum), iSize/8); |
| 602 | return 0; |
| 603 | } |
| 604 | |
| 605 | /* |
| 606 | ** Compute the SHA3 checksum of a zero-terminated string. The |
| 607 | ** result is held in memory obtained from mprintf(). |
| 608 | */ |
| 609 | char *sha3sum(const char *zIn, int iSize){ |
| @@ -610,13 +611,14 @@ | |
| 610 | SHA3Context ctx; |
| 611 | char zDigest[132]; |
| 612 | |
| 613 | SHA3Init(&ctx, iSize); |
| 614 | SHA3Update(&ctx, (unsigned const char*)zIn, strlen(zIn)); |
| 615 | DigestToBase16(SHA3Final(&ctx), zDigest, iSize/4); |
| 616 | return mprintf("%s", zDigest); |
| 617 | } |
| 618 | |
| 619 | /* |
| 620 | ** COMMAND: sha3sum* |
| 621 | ** |
| 622 | ** Usage: %fossil sha3sum FILE... |
| 623 |
| --- src/sha3.c | |
| +++ src/sha3.c | |
| @@ -600,10 +600,11 @@ | |
| 600 | blob_resize(pCksum, iSize/4); |
| 601 | DigestToBase16(SHA3Final(&ctx), blob_buffer(pCksum), iSize/8); |
| 602 | return 0; |
| 603 | } |
| 604 | |
| 605 | #if 0 /* NOT USED */ |
| 606 | /* |
| 607 | ** Compute the SHA3 checksum of a zero-terminated string. The |
| 608 | ** result is held in memory obtained from mprintf(). |
| 609 | */ |
| 610 | char *sha3sum(const char *zIn, int iSize){ |
| @@ -610,13 +611,14 @@ | |
| 611 | SHA3Context ctx; |
| 612 | char zDigest[132]; |
| 613 | |
| 614 | SHA3Init(&ctx, iSize); |
| 615 | SHA3Update(&ctx, (unsigned const char*)zIn, strlen(zIn)); |
| 616 | DigestToBase16(SHA3Final(&ctx), zDigest, iSize/8); |
| 617 | return mprintf("%s", zDigest); |
| 618 | } |
| 619 | #endif |
| 620 | |
| 621 | /* |
| 622 | ** COMMAND: sha3sum* |
| 623 | ** |
| 624 | ** Usage: %fossil sha3sum FILE... |
| 625 |