Re: [viff-devel] Bitonic sort

2008-08-12 Thread Martin Geisler
Ivan Bjerre Damgaard [EMAIL PROTECTED] writes:

 Martin Geisler [EMAIL PROTECTED] writes:

 I began looking at card shuffling because I want to make a small
 tutorial for VIFF, something that will explain how to make a
 program. And for that I figured that some card game would be cool.
 I don't know which game yet, so let let me know if you have any
 good idea!

 Blackjack perhaps? seems simple in that you just draw cards until
 you win or loose. Can also be played with 3 people, one being the
 bank - so you don't necessarily need 2-party computing.

Yeah, I guess Blackjack would work. I don't know much about card
games, so I looked up the rules on Wikipedia and found that they were
a lot more complicated than I thought :-)

  http://en.wikipedia.org/wiki/Blackjack

But if we simplify things to the core, then I think it would be okay
to program, even for a tutorial. So the game would go like this:

* Cards are shuffled. Using MPC here gives us a fair shuffle where
  neither the bank nor the players learns anything about the order.

* Each player is dealt two cards == two secret shares are opened to
  each player. For the dealer one opening is done to all players.

* Each player can now choose either hit (get a new card) or stand
  (finished).

* When everybody stands, the dealer would normally reveal his
  unopened card and the one with the best hand wins (as long as the
  hand is less than 21).

  We could do the comparisons securely instead instead of opening here
  and I guess that would remove some of the chance for card counting.

* When the comparisons are done the winners and loosers are announced
  to everybody and a new round can begin using the remaining cards.

That doesn't sound too bad... I don't know when I'll get around to
implementing it and you guys are welcome to beat me to it! :-)

-- 
Martin Geisler


pgpcrGL6eJv5y.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Bitonic sort

2008-08-11 Thread Ivan Bjerre Damgaard
Quoting Martin Geisler [EMAIL PROTECTED]:

 Martin Geisler [EMAIL PROTECTED] writes:

  It does 466 comparisons to sort 52 numbers (32-bit) and it takes
  about 4 minutes both share and sort the numbers on thyra{01,02,03}
  on DAIMI.

 In case nobody has noticed, I wanted to see how long it would take to
 sort 52 numbers since doing so would give me a way to shuffle a deck
 of cards: assign a random number to each card and sort the random
 numbers. If there are no collisions in the random numbers you will get
 back a nicely shuffled deck.

 I began looking at card shuffling because I want to make a small
 tutorial for VIFF, something that will explain how to make a program.
 And for that I figured that some card game would be cool. I don't know
 which game yet, so let let me know if you have any good idea!

Blackjack perhaps? seems simple in that you just draw cards until you win or
loose. Can also be played with 3 people, one being the bank - so you don't
necessarily need 2-party computing.
Poker is also a posibility, but more complex, I guess.

regards, Ivan
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Bitonic sort

2008-08-09 Thread Martin Geisler
Martin Geisler [EMAIL PROTECTED] writes:

 It does 466 comparisons to sort 52 numbers (32-bit) and it takes
 about 4 minutes both share and sort the numbers on thyra{01,02,03}
 on DAIMI.

In case nobody has noticed, I wanted to see how long it would take to
sort 52 numbers since doing so would give me a way to shuffle a deck
of cards: assign a random number to each card and sort the random
numbers. If there are no collisions in the random numbers you will get
back a nicely shuffled deck.

I began looking at card shuffling because I want to make a small
tutorial for VIFF, something that will explain how to make a program.
And for that I figured that some card game would be cool. I don't know
which game yet, so let let me know if you have any good idea!

-- 
Martin Geisler


pgpFbMUIg6zBc.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk