<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -157,15 +157,15 @@ LUALIB_API int luaopen_tc(lua_State *L) {
     lua_settable(L, -3);
 
     /* Make hash descriptors module variables. */
-    LtcHashDescriptor *tc_hash;
+    const struct ltc_hash_descriptor **hash;
 #ifdef LTC_WHIRLPOOL
     lua_pushliteral(L, &quot;whirlpool_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;whirlpool_desc;
+    *hash = &amp;whirlpool_desc;
 
     lua_settable(L, -3);
 #endif
@@ -173,11 +173,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_SHA512
     lua_pushliteral(L, &quot;sha512_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;sha512_desc;
+    *hash = &amp;sha512_desc;
 
     lua_settable(L, -3);
 #endif
@@ -185,11 +185,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_SHA384
     lua_pushliteral(L, &quot;sha384_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;sha384_desc;
+    *hash = &amp;sha384_desc;
 
     lua_settable(L, -3);
 #endif
@@ -197,11 +197,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_SHA256
     lua_pushliteral(L, &quot;sha256_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;sha256_desc;
+    *hash = &amp;sha256_desc;
 
     lua_settable(L, -3);
 #endif
@@ -209,11 +209,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_SHA224
     lua_pushliteral(L, &quot;sha224_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;sha224_desc;
+    *hash = &amp;sha224_desc;
 
     lua_settable(L, -3);
 #endif
@@ -221,11 +221,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_SHA1
     lua_pushliteral(L, &quot;sha1_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;sha1_desc;
+    *hash = &amp;sha1_desc;
 
     lua_settable(L, -3);
 #endif
@@ -233,11 +233,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_MD5
     lua_pushliteral(L, &quot;md5_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;md5_desc;
+    *hash = &amp;md5_desc;
 
     lua_settable(L, -3);
 #endif
@@ -245,11 +245,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_MD4
     lua_pushliteral(L, &quot;md4_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;md4_desc;
+    *hash = &amp;md4_desc;
 
     lua_settable(L, -3);
 #endif
@@ -257,11 +257,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_MD2
     lua_pushliteral(L, &quot;md2_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;md2_desc;
+    *hash = &amp;md2_desc;
 
     lua_settable(L, -3);
 #endif
@@ -269,11 +269,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_TIGER
     lua_pushliteral(L, &quot;tiger_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;tiger_desc;
+    *hash = &amp;tiger_desc;
 
     lua_settable(L, -3);
 #endif
@@ -281,11 +281,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_RIPEMD128
     lua_pushliteral(L, &quot;rmd128_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;rmd128_desc;
+    *hash = &amp;rmd128_desc;
 
     lua_settable(L, -3);
 #endif
@@ -293,11 +293,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_RIPEMD160
     lua_pushliteral(L, &quot;rmd160_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;rmd160_desc;
+    *hash = &amp;rmd160_desc;
 
     lua_settable(L, -3);
 #endif
@@ -305,11 +305,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_RIPEMD256
     lua_pushliteral(L, &quot;rmd256_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;rmd256_desc;
+    *hash = &amp;rmd256_desc;
 
     lua_settable(L, -3);
 #endif
@@ -317,11 +317,11 @@ LUALIB_API int luaopen_tc(lua_State *L) {
 #ifdef LTC_RIPEMD320
     lua_pushliteral(L, &quot;rmd320_desc&quot;);
 
-    tc_hash = (LtcHashDescriptor *) lua_newuserdata(L, sizeof(LtcHashDescriptor));
+    hash = (const struct ltc_hash_descriptor **) lua_newuserdata(L, sizeof(struct ltc_hash_descriptor *));
     luaL_getmetatable(L, &quot;TomCrypt.LtcHashDescriptor&quot;);
     lua_setmetatable(L, -2);
 
-    tc_hash-&gt;hash = &amp;rmd320_desc;
+    *hash = &amp;rmd320_desc;
 
     lua_settable(L, -3);
 #endif</diff>
      <filename>tomcrypt.c</filename>
    </modified>
    <modified>
      <diff>@@ -22,20 +22,15 @@
  * THE SOFTWARE.
 */
 
-/* LtcHashDescriptor user data */
-typedef struct LtcHashDescriptor {
-    const struct ltc_hash_descriptor *hash;
-} LtcHashDescriptor;
-
 /* register_hash(ltc_hash_descriptor) */
 static int tc_register_hash(lua_State *L) {
-    LtcHashDescriptor *tc_hash;
+    struct ltc_hash_descriptor **hash;
 
     /* Get function arguments */
-    tc_hash = (LtcHashDescriptor *) luaL_checkudata(L, 1, &quot;TomCrypt.LtcHashDescriptor&quot;);
-    luaL_argcheck(L, tc_hash != NULL, 1, &quot;`ltc_hash_descriptor' expected&quot;);
+    hash = (struct ltc_hash_descriptor **) luaL_checkudata(L, 1, &quot;TomCrypt.LtcHashDescriptor&quot;);
+    luaL_argcheck(L, hash != NULL, 1, &quot;`ltc_hash_descriptor' expected&quot;);
 
-    if (register_hash(tc_hash-&gt;hash) == -1) {
+    if (register_hash(*hash) == -1) {
         /* Push nil and error message */
         lua_pushnil(L);
         lua_pushstring(L, &quot;register failed&quot;);
@@ -48,13 +43,13 @@ static int tc_register_hash(lua_State *L) {
 
 /* register_hash(ltc_hash_descriptor) */
 static int tc_unregister_hash(lua_State *L) {
-    LtcHashDescriptor *tc_hash;
+    struct ltc_hash_descriptor **hash;
 
     /* Get function arguments */
-    tc_hash = (LtcHashDescriptor *) luaL_checkudata(L, 1, &quot;TomCrypt.LtcHashDescriptor&quot;);
-    luaL_argcheck(L, tc_hash != NULL, 1, &quot;`ltc_hash_descriptor' expected&quot;);
+    hash = (struct ltc_hash_descriptor **) luaL_checkudata(L, 1, &quot;TomCrypt.LtcHashDescriptor&quot;);
+    luaL_argcheck(L, hash != NULL, 1, &quot;`ltc_hash_descriptor' expected&quot;);
 
-    if (unregister_hash(tc_hash-&gt;hash) == -1) {
+    if (unregister_hash(*hash) == -1) {
         /* Push nil and error message */
         lua_pushnil(L);
         lua_pushstring(L, &quot;unregister failed&quot;);</diff>
      <filename>tomcrypt_hash.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>074e29b76c6c91fa254bed4550b5293ca6205103</id>
    </parent>
  </parents>
  <author>
    <name>Ali Polatel</name>
    <email>hawking@gentoo.org</email>
  </author>
  <url>http://github.com/alip/luatomcrypt/commit/fcefd2b9063ced1360f226f968f2569d9f7847a3</url>
  <id>fcefd2b9063ced1360f226f968f2569d9f7847a3</id>
  <committed-date>2008-10-17T10:33:57-07:00</committed-date>
  <authored-date>2008-10-17T10:33:57-07:00</authored-date>
  <message>Use struct ltc_hash_descriptor instead of LtcHashDescriptor.</message>
  <tree>08c22f47671f6b85836fd3cf3065713b48034c75</tree>
  <committer>
    <name>Ali Polatel</name>
    <email>hawking@gentoo.org</email>
  </committer>
</commit>
