func SolvePuzzleRC6(ciphertext []byte, puzzle crypto.Puzzle) (message []byte, err error) {
	if puzzle == nil {
		err = fmt.Errorf("Puzzle cannot be nil, what are you solving")
		return
	}

	var key []byte
	if key, err = puzzle.Solve(); err != nil {
		err = fmt.Errorf("Error solving auction puzzle: %s", err)
		return
	}

	var RC6Cipher cipher.Block
	if RC6Cipher, err = rc6.New(key); err != nil {
		err = fmt.Errorf("Could not create new rc6 cipher for puzzle: %s", err)
		return
	}

	// check to make sure we're going to succeed when decrypting
	if len(ciphertext) < RC6Cipher.BlockSize() {
		err = fmt.Errorf("ciphertext less than blocksize, make a bigger ciphertext")
		return
	}

	// Split up IV into ciphertext and IV
	var iv []byte
	iv = ciphertext[:RC6Cipher.BlockSize()]

	// Don't decrypt the IV
	ciphertext = ciphertext[RC6Cipher.BlockSize():]

	// Make decrypter
	var cfbDecrypter cipher.Stream
	cfbDecrypter = cipher.NewCFBDecrypter(RC6Cipher, iv)

	// make message and then decrypt
	message = make([]byte, len(ciphertext))

	cfbDecrypter.XORKeyStream(message, ciphertext)

	return
}
// SolvePuzzleRC6 solves the timelock puzzle and decrypts the ciphertext using RC6
SolvePuzzleRC6 solves the timelock puzzle and decrypts the ciphertext using RC6
// SolvePuzzleRC6 solves the timelock puzzle and decrypts the ciphertext using RC6
func SolvePuzzleRC6(ciphertext []byte, puzzle crypto.Puzzle) (message []byte, err error) {
	if puzzle == nil {
		err = fmt.Errorf("Puzzle cannot be nil, what are you solving")
		return
	}
	var key []byte
	if key, err = puzzle.Solve(); err != nil {
		err = fmt.Errorf("Error solving auction puzzle: %s", err)
		return
	}
	var RC6Cipher cipher.Block
	if RC6Cipher, err = rc6.New(key); err != nil {
		err = fmt.Errorf("Could not create new rc6 cipher for puzzle: %s", err)
		return
	}
	if len(ciphertext) < RC6Cipher.BlockSize() {
		err = fmt.Errorf("ciphertext less than blocksize, make a bigger ciphertext")
		return
	}
	var iv []byte
	iv = ciphertext[:RC6Cipher.BlockSize()]
	ciphertext = ciphertext[RC6Cipher.BlockSize():]
	var cfbDecrypter cipher.Stream
	cfbDecrypter = cipher.NewCFBDecrypter(RC6Cipher, iv)
	message = make([]byte, len(ciphertext))
	cfbDecrypter.XORKeyStream(message, ciphertext)
	return
}
func SolvePuzzleRC6 ( ciphertext [ ] byte , puzzle crypto . Puzzle ) ( message [ ] byte , err error ) { if puzzle == nil { err = fmt . Errorf ( " " ) return } var key [ ] byte if key , err = puzzle . Solve ( ) ; err != nil { err = fmt . Errorf ( " " , err ) return } var RC6Cipher cipher . Block if RC6Cipher , err = rc6 . New ( key ) ; err != nil { err = fmt . Errorf ( " " , err ) return } if len ( ciphertext ) < RC6Cipher . BlockSize ( ) { err = fmt . Errorf ( " " ) return } var iv [ ] byte iv = ciphertext [ : RC6Cipher . BlockSize ( ) ] ciphertext = ciphertext [ RC6Cipher . BlockSize ( ) : ] var cfbDecrypter cipher . Stream cfbDecrypter = cipher . NewCFBDecrypter ( RC6Cipher , iv ) message = make ( [ ] byte , len ( ciphertext ) ) cfbDecrypter . XORKeyStream ( message , ciphertext ) return }
SolvePuzzleRC6 solves the timelock puzzle and decrypts the ciphertext using RC6
SolvePuzzleRC6 solves the timelock puzzle and decrypts the ciphertext using RC6
// check to make sure we're going to succeed when decrypting // Split up IV into ciphertext and IV // Don't decrypt the IV // Make decrypter // make message and then decrypt