Changeset: b8c59031b8da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b8c59031b8da
Modified Files:
common/utils/ripemd160.c
common/utils/rmd160.c
common/utils/rmd160.h
Branch: default
Log Message:
Make sure the rmd160 functions get called and not something from some weird .so
somewhere.
diffs (154 lines):
diff --git a/common/utils/ripemd160.c b/common/utils/ripemd160.c
--- a/common/utils/ripemd160.c
+++ b/common/utils/ripemd160.c
@@ -39,7 +39,7 @@ RIPEMD160Input(RIPEMD160Context *ctxt, c
bytecount -= ctxt->noverflow;
bytes += ctxt->noverflow;
ctxt->noverflow = 0;
- compress(ctxt->digest, X);
+ MDcompress(ctxt->digest, X);
}
while (bytecount >= 64) {
for (int i = 0; i < 16; i++) {
@@ -47,7 +47,7 @@ RIPEMD160Input(RIPEMD160Context *ctxt, c
bytes += 4;
}
bytecount -= 64;
- compress(ctxt->digest, X);
+ MDcompress(ctxt->digest, X);
}
if (bytecount > 0)
memcpy(ctxt->overflow, bytes, bytecount);
diff --git a/common/utils/rmd160.c b/common/utils/rmd160.c
--- a/common/utils/rmd160.c
+++ b/common/utils/rmd160.c
@@ -12,23 +12,23 @@
*
* Copyright (c) 1996 Katholieke Universiteit Leuven
*
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be
+ * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
\********************************************************************/
@@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "rmd160.h"
+#include "rmd160.h"
/********************************************************************/
@@ -54,7 +54,7 @@ void MDinit(dword *MDbuf)
/********************************************************************/
-void compress(dword *MDbuf, dword *X)
+void MDcompress(dword *MDbuf, dword *X)
{
dword aa = MDbuf[0], bb = MDbuf[1], cc = MDbuf[2],
dd = MDbuf[3], ee = MDbuf[4];
@@ -78,7 +78,7 @@ void compress(dword *MDbuf, dword *X)
FF(cc, dd, ee, aa, bb, X[13], 7);
FF(bb, cc, dd, ee, aa, X[14], 9);
FF(aa, bb, cc, dd, ee, X[15], 8);
-
+
/* round 2 */
GG(ee, aa, bb, cc, dd, X[ 7], 7);
GG(dd, ee, aa, bb, cc, X[ 4], 6);
@@ -170,7 +170,7 @@ void compress(dword *MDbuf, dword *X)
JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6);
/* parallel round 2 */
- III(eee, aaa, bbb, ccc, ddd, X[ 6], 9);
+ III(eee, aaa, bbb, ccc, ddd, X[ 6], 9);
III(ddd, eee, aaa, bbb, ccc, X[11], 13);
III(ccc, ddd, eee, aaa, bbb, X[ 3], 15);
III(bbb, ccc, ddd, eee, aaa, X[ 7], 7);
@@ -205,7 +205,7 @@ void compress(dword *MDbuf, dword *X)
HHH(eee, aaa, bbb, ccc, ddd, X[ 4], 7);
HHH(ddd, eee, aaa, bbb, ccc, X[13], 5);
- /* parallel round 4 */
+ /* parallel round 4 */
GGG(ccc, ddd, eee, aaa, bbb, X[ 8], 15);
GGG(bbb, ccc, ddd, eee, aaa, X[ 6], 5);
GGG(aaa, bbb, ccc, ddd, eee, X[ 4], 8);
@@ -272,17 +272,16 @@ void MDfinish(dword *MDbuf, byte *strptr
if ((lswlen & 63) > 55) {
/* length goes to next block */
- compress(MDbuf, X);
+ MDcompress(MDbuf, X);
memset(X, 0, 16*sizeof(dword));
}
/* append length in bits*/
X[14] = lswlen << 3;
X[15] = (lswlen >> 29) | (mswlen << 3);
- compress(MDbuf, X);
+ MDcompress(MDbuf, X);
return;
}
/************************ end of file rmd160.c **********************/
-
diff --git a/common/utils/rmd160.h b/common/utils/rmd160.h
--- a/common/utils/rmd160.h
+++ b/common/utils/rmd160.h
@@ -128,18 +128,21 @@ typedef int the_correct_size_was_chosen
/* function prototypes */
-void MDinit(dword *MDbuf);
+void MDinit(dword *MDbuf)
+ __attribute__((__visibility__("hidden")));
/*
* initializes MDbuffer to "magic constants"
*/
-void compress(dword *MDbuf, dword *X);
+void MDcompress(dword *MDbuf, dword *X)
+ __attribute__((__visibility__("hidden")));
/*
* the compression function.
* transforms MDbuf using message bytes X[0] through X[15]
*/
-void MDfinish(dword *MDbuf, byte *strptr, dword lswlen, dword mswlen);
+void MDfinish(dword *MDbuf, byte *strptr, dword lswlen, dword mswlen)
+ __attribute__((__visibility__("hidden")));
/*
* puts bytes from strptr into X and pad out; appends length
* and finally, compresses the last block(s)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list