[Mono-dev] Mono.Simd and Threefish256

2009-10-01 Thread Marcus Griep
As part of my free time, I decided to start down the path to SIMD-ing
some cryptography algorithms. As a starter exercise, I took Threefish256
from the SHA-3 submission Skein. The experience was very enlightening,
and as I haven't been able to find anything of substance out there about
working with Mono.Simd, I thought I'd write some articles about it.

I'm posting my experience to my blog in a 5-part series. The first of
the posts has already been published, and I'll have the rest ready by
the end of the weekend:

http://blog.xpdm.us/2009/10/01/skein-threefish-and-mono-simd-part-1/

Thanks to all the folks who've been keeping the Mono.Simd project going.

--
Marcus Griep


signature.asc
Description: This is a digitally signed message part
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Update C5 to v1.1.0

2009-08-06 Thread Marcus Griep
I have posted an update with the unit tests disabled. 

Because the first patch was large and difficult to prepare in the first
place, I have let it be, and added a second, meta patch, which is to be
applied to the results of the first patch. Here are the links again:

http://wiki.xpdm.us/_media/mono/v1.1.0.patch.gz
http://wiki.xpdm.us/_media/mono/v1.1.0.meta.patch

They should be applied in that order, and the result should `make check`
properly.

I still have not heard back from the original maintainers, so I will be
working proactively to maintain the library going forward, including
fixing up the test cases and general code base to quality expectations.

On Fri, 2009-07-31 at 13:46 +0200, Zoltan Varga wrote:
 Hi,
 
   Since the old version could run its unit tests under mono, the new
 version should too, or the
 failing tests should be disabled.
 
  Zoltan
 
 On Fri, Jul 31, 2009 at 1:48 AM, Marcus Griep mar...@griep.us wrote:
 I did notice these, and I'll go over each of them. I figured
 that the
 priority was getting the verbatim upstream ported over and
 then fixing
 them since the upstream hasn't been maintained since this
 version was
 released.
 
 Several hash table tests depend on DEBUG-mode specific
 behavior; when
 compiled with DEBUG defined, hash tables use a preset seed,
 but when
 compiled for release, hash tables are randomized. The majority
 of the
 failures in the unit tests are due to this.
 
 There is one failure that is due to a method not being
 implemented in
 v1.1.0, hence the not implemented exception. I can correct
 this as
 well.
 
 What would be the proper way to proceed here?
 
 
 
 On Thu, 2009-07-30 at 22:40 +0200, Zoltan Varga wrote:
  Hi,
 
The patch applies cleanly, but there are some test
 failures when
  running 'make check'
  in the Mono.C5 directory.
 
  Zoltan
 
  On Thu, Jul 30, 2009 at 5:49 PM, Marcus Griep
 mar...@griep.us wrote:
  I am not attaching the patch here directly because,
 even
  gzip'ed, it
  stands at over 450KB. Instead, it is being hosted at
  http://wiki.xpdm.us/_media/mono/v1.1.0.patch.gz
 
  The library in general is still in need of some TLC,
 and as
  the upstream
  hasn't been updated in a year and a half, I am
 trying to
  contact the
  original developers of C5 to determine if there will
 be
  further
  development. If not, I will likely be maintaining a
 new
  repository for
  C5 and plan to continue maintaining and developing
 the C5
  library, as
  well as providing updates for Mono.C5.
 
  Also, be aware that there may be line ending issues
 when
  applying this
  patch.
 
  --
  Marcus Griep
  GPG Key ID: 0x070E3F2D
  ——
  https://torproj.xpdm.us
  Ακακια את.ψο´, 3°
 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
 
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 
 --
 
 Marcus Griep
 GPG Key ID: 0x070E3F2D
 ——
 https://torproj.xpdm.us
 Ακακια את.ψο´, 3°
 
 
-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°


signature.asc
Description: This is a digitally signed message part
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Update C5 to v1.1.0

2009-07-30 Thread Marcus Griep
I am not attaching the patch here directly because, even gzip'ed, it
stands at over 450KB. Instead, it is being hosted at
http://wiki.xpdm.us/_media/mono/v1.1.0.patch.gz

The library in general is still in need of some TLC, and as the upstream
hasn't been updated in a year and a half, I am trying to contact the
original developers of C5 to determine if there will be further
development. If not, I will likely be maintaining a new repository for
C5 and plan to continue maintaining and developing the C5 library, as
well as providing updates for Mono.C5.

Also, be aware that there may be line ending issues when applying this
patch.

-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°


signature.asc
Description: This is a digitally signed message part
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Update C5 to v1.1.0

2009-07-30 Thread Marcus Griep
I did notice these, and I'll go over each of them. I figured that the
priority was getting the verbatim upstream ported over and then fixing
them since the upstream hasn't been maintained since this version was
released.

Several hash table tests depend on DEBUG-mode specific behavior; when
compiled with DEBUG defined, hash tables use a preset seed, but when
compiled for release, hash tables are randomized. The majority of the
failures in the unit tests are due to this.

There is one failure that is due to a method not being implemented in
v1.1.0, hence the not implemented exception. I can correct this as
well.

What would be the proper way to proceed here?


On Thu, 2009-07-30 at 22:40 +0200, Zoltan Varga wrote:
 Hi,
 
   The patch applies cleanly, but there are some test failures when
 running 'make check'
 in the Mono.C5 directory.
 
 Zoltan
 
 On Thu, Jul 30, 2009 at 5:49 PM, Marcus Griep mar...@griep.us wrote:
 I am not attaching the patch here directly because, even
 gzip'ed, it
 stands at over 450KB. Instead, it is being hosted at
 http://wiki.xpdm.us/_media/mono/v1.1.0.patch.gz
 
 The library in general is still in need of some TLC, and as
 the upstream
 hasn't been updated in a year and a half, I am trying to
 contact the
 original developers of C5 to determine if there will be
 further
 development. If not, I will likely be maintaining a new
 repository for
 C5 and plan to continue maintaining and developing the C5
 library, as
 well as providing updates for Mono.C5.
 
 Also, be aware that there may be line ending issues when
 applying this
 patch.
 
 --
 Marcus Griep
 GPG Key ID: 0x070E3F2D
 ——
 https://torproj.xpdm.us
 Ακακια את.ψο´, 3°
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°


signature.asc
Description: This is a digitally signed message part
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [PATCH] Change Mono.C5 from common lib to net_2_0 lib

2009-07-17 Thread Marcus Griep
Currently Mono.C5 builds even as part of the net_1_1 profile. This is
unnecessary as Mono.C5 provides and consumes generics, and thus depends
on net_2_0 at minimum. In order to build in net_1_1, all the files in
Mono.C5 are surrounded by #ifdef NET_2_0 directives, leading to
effectively empty files being built into an uninstalled library in the
net_1_1 profile.

This patch cleans up the Mono.C5 build by moving it to the net_2_0
profile and removing the now unnecessary #ifdef guards.
-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°
Index: class/Makefile
===
--- class/Makefile	(revision 137818)
+++ class/Makefile	(working copy)
@@ -39,7 +39,6 @@
 	System.Drawing			\
 	System.Transactions		\
 	System.EnterpriseServices	\
-	Mono.C5\
 	Mono.Data.Tds			\
 	System.Data			\
 	Mono.Data			\
@@ -116,6 +115,7 @@
 	System.ServiceModel		\
 	System.ServiceModel.Web		\
 	System.Web.Mvc			\
+	Mono.C5\
 	Mono.Management			\
 	Mono.Options 			\
 	Mono.Simd			\
Index: class/Mono.C5/add-conditional.pl
===
--- class/Mono.C5/add-conditional.pl	(revision 137818)
+++ class/Mono.C5/add-conditional.pl	(working copy)
@@ -1,16 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-foreach my $file (@ARGV) {
-open FILE,+,$file;
-my $contents = ;
-while (defined ($_ = FILE)) {
-	$contents .= $_;
-}
-truncate FILE, 0;
-seek FILE, 0, 0;
-print FILE #if NET_2_0\n;
-print FILE $contents . \n;
-print FILE #endif\n;
-close FILE;
-}
Index: class/Mono.C5/C5/Dictionaries.cs
===
--- class/Mono.C5/C5/Dictionaries.cs	(revision 137818)
+++ class/Mono.C5/C5/Dictionaries.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1294,4 +1293,3 @@
 
   }
 }
-#endif
Index: class/Mono.C5/C5/hashing/HashTable.cs
===
--- class/Mono.C5/C5/hashing/HashTable.cs	(revision 137818)
+++ class/Mono.C5/C5/hashing/HashTable.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1599,5 +1598,3 @@
 
   }
 }
-
-#endif
Index: class/Mono.C5/C5/hashing/HashBag.cs
===
--- class/Mono.C5/C5/hashing/HashBag.cs	(revision 137818)
+++ class/Mono.C5/C5/hashing/HashBag.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -677,5 +676,3 @@
 #endregion
   }
 }
-
-#endif
Index: class/Mono.C5/C5/hashing/HashDictionary.cs
===
--- class/Mono.C5/C5/hashing/HashDictionary.cs	(revision 137818)
+++ class/Mono.C5/C5/hashing/HashDictionary.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -76,4 +75,3 @@
 
   }
 }
-#endif
Index: class/Mono.C5/C5/Collections.cs
===
--- class/Mono.C5/C5/Collections.cs	(revision 137818)
+++ class/Mono.C5/C5/Collections.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1519,5 +1518,3 @@
 #endregion
   }
 }
-
-#endif
Index: class/Mono.C5/C5/trees/RedBlackTreeDictionary.cs
===
--- class/Mono.C5/C5/trees/RedBlackTreeDictionary.cs	(revision 137818)
+++ class/Mono.C5/C5/trees/RedBlackTreeDictionary.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -79,4 +78,3 @@
 
   }
 }
-#endif
Index: class/Mono.C5/C5/trees/RedBlackTreeBag.cs
===
--- class/Mono.C5/C5/trees/RedBlackTreeBag.cs	(revision 137818)
+++ class/Mono.C5/C5/trees/RedBlackTreeBag.cs	(working copy)
@@ -1,4 +1,3 @@
-#if NET_2_0
 /*
  Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -4488,6 +4487,3 @@
 
   }
 }
-
-
-#endif
Index: class/Mono.C5/C5/trees/RedBlackTreeSet.cs
===
--- class/Mono.C5/C5/trees/RedBlackTreeSet.cs	(revision 137818)
+++ class/Mono.C5/C5/trees/RedBlackTreeSet.cs	(working copy

[Mono-dev] [PATCH] Squash 444388 and catch miss on 323096

2009-07-09 Thread Marcus Griep
Bug 444388 [https://bugzilla.novell.com/show_bug.cgi?id=444388] is a
pretty obscure bug that hits very few people, but I find myself among
them. Attempting to bring the latest version of C5 to Mono, I found an
issue with member resolution when interfaces hide members of parent
interfaces.

After sitting on it for a while, I was able to reach my own itch. The
full explanation is long, and if you're interested in the background of
the bug and how I came to this patch, check my *full* writeup here:
http://wiki.xpdm.us/mono/bug444388. 

The executive summary is that this patch fixes 444388, and also fixes a
bug introduced by the fix to 323096 (which caused incorrect resolution
in similar cases). As well, it adds two additional test cases to the
test suite to prevent future regressions.

If that's too succinct, let me know, and I'll respond more fully to the
list.

-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°
Index: tests/ver-il-gmcs.xml
===
--- tests/ver-il-gmcs.xml	(revision 137658)
+++ tests/ver-il-gmcs.xml	(working copy)
@@ -42689,4 +42689,49 @@
   /method
 /type
   /test
-/tests
\ No newline at end of file
+  test name=test-723.cs
+type name=Test
+  method name=Void .ctor()
+size7/size
+  /method
+  method name=Int32 get_Count()
+size2/size
+  /method
+/type
+type name=Maine
+  method name=Void .ctor()
+size7/size
+  /method
+  method name=Int32 Main()
+size21/size
+  /method
+/type
+  /test
+  test name=test-724.cs
+type name=Concrete
+  method name=Void .ctor()
+size7/size
+  /method
+  method name=String A.get_Spec()
+size6/size
+  /method
+  method name=String B.get_Spec()
+size6/size
+  /method
+  method name=String get_Spec()
+size6/size
+  /method
+/type
+type name=Test
+  method name=Void .ctor()
+size7/size
+  /method
+  method name=Int32 DoTest(String, String, String, Int32)
+size29/size
+  /method
+  method name=Int32 Main()
+size110/size
+  /method
+/type
+  /test
+/tests
Index: tests/test-724.cs
===
--- tests/test-724.cs	(revision 0)
+++ tests/test-724.cs	(revision 0)
@@ -0,0 +1,46 @@
+public class Test
+{
+	private static int DoTest (string type, string expected, string actual, int failcode)
+	{
+		if (! actual.Equals (expected)) {
+			System.Console.WriteLine (Bad {0}: Expected {1}, Was {2},
+			   type, expected, actual);
+			return failcode;
+		}
+		return 0;
+	}
+
+	public static int Main ()
+	{
+		int failure = 0;
+		Concrete val = new Concrete ();
+
+		failure |= DoTest(A, A, ((A) val).Spec, 0x01);
+		failure |= DoTest(B, B, ((B) val).Spec, 0x02);
+		failure |= DoTest(C, B, ((C) val).Spec, 0x04);
+		failure |= DoTest(Concrete, Concrete, val.Spec, 0x08);
+
+		return failure;
+	}
+}
+
+interface A
+{
+	string Spec { get; }
+}
+
+interface B : A
+{
+	new string Spec { get; }
+}
+
+interface C : B
+{
+}
+
+class Concrete : C
+{
+	string A.Spec { get { return A; } }
+	string B.Spec { get { return B; } }
+	public string Spec { get { return Concrete; } }
+}
Index: tests/test-723.cs
===
--- tests/test-723.cs	(revision 0)
+++ tests/test-723.cs	(revision 0)
@@ -0,0 +1,34 @@
+interface ICollectionValue
+{
+  int Count { get; }
+}
+
+interface ISCGCollection
+{
+  int Count { get; }
+}
+
+interface ICollection : ISCGCollection, ICollectionValue
+{
+  new int Count { get; }
+}
+
+interface ISequenced : ICollection
+{
+}
+
+class Test : ISequenced
+{
+  public int Count { get { return 0; } }
+}
+
+static class Maine
+{
+  public static int Main ()
+  {
+ISequenced t = new Test ();
+if (t.Count != 0)
+  return 1;
+return 0;
+  }
+}
Index: mcs/ecore.cs
===
--- mcs/ecore.cs	(revision 137658)
+++ mcs/ecore.cs	(working copy)
@@ -715,27 +715,34 @@
 		continue;
 	}
 
-	if (non_methods == null) {
+	if (non_methods == null)
 		non_methods = new ArrayList (2);
-		non_methods.Add (m);
-		continue;
-	}
 
-	foreach (MemberInfo n_m in non_methods) {
-		if (m.DeclaringType.IsInterface  TypeManager.ImplementsInterface (m.DeclaringType, n_m.DeclaringType))
+	foreach (MemberInfo n_m in (ArrayList)non_methods.Clone()) {
+		if (n_m.DeclaringType.IsInterface  TypeManager.ImplementsInterface (m.DeclaringType, n_m.DeclaringType)) {
+			non_methods.Remove (n_m);
+		} else if (m.DeclaringType.IsInterface  TypeManager.ImplementsInterface (n_m.DeclaringType, m.DeclaringType)) {
 			continue;
-
-		Report.SymbolRelatedToPreviousError (m);
-		Report.Error (229, loc, Ambiguity between `{0}' and `{1

[Mono-dev] Integrating Mono.Simd into Mono.Math, Mono.Security

2009-06-08 Thread Marcus Griep
Hello all,

First, by way of introduction, I'm Marcus Griep, a .NET/Mono
developer for some time now, and a contributor to such projects as
Boo, C5, and git.

In a sort of scratch-my-own-itch style, I'm looking to speed up the
computationally time consuming steps of BigInteger math by using
Mono.Simd in Mono.Math. This would then vicariously speed up various
cryptographic functions that rely on BigIntegers, such as primality
tests in RSA, and could be futher extended to using Mono.Simd
throughout Mono.Security.

Mono.Math resides within Mono.Security, so I would be creating a
dependency from Mono.Security to Mono.Simd. Also, Mono.Math is
incorporated internally within corlib, which would probably mean
interning Mono.Simd in corlib as well.

One confounding factor is that Mono.Simd uses extension methods,
thus depending on System.Core, and being a 2.0-only library. With
the 1.1 world still around, incorporation of Mono.Simd into corlib
and Mono.Security will probably require some precision cuts to get
1.1 working independently of Mono.Simd, while letting 2.0 utilize
it. (Another option is to reduce the dependency on the
VectorOperations extension methods, making them normal static
methods when built to 1.1).

The intended outcome is that Mono's cryptographic libraries will see
a nice speedup when run on systems supporting SIMD.

Since this is my first major delve into Mono, in a contributory
sense, any input, corrections, or advice are welcome as I try to
wrap my head around what actually needs to be done.

-- 
Marcus Griep
GPG Key ID: 0x070E3F2D
——
https://torproj.xpdm.us
Ακακια את.ψο´, 3°



signature.asc
Description: OpenPGP digital signature
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list