#!/usr/bin/env python

#  Copyright 2014 Chris Kuethe

import StringIO
from pysssslib import s4_decode


inbuf = []
x = '4dd42fd883c62f3f7d4bb8d715663976500e2895f578e251591355c44b11ad1573a9d68faab458d0e9b5e4fccf6ef41fdd5aa00695ec9324deba9213b29ee6e8'.decode('hex')
inbuf.append(StringIO.StringIO(x))
x = '475c32bf6f61c424dcea3482230091c644954b9ac0b324324155d5a55ffc45c447c6afe5cff109022e95495626afdc2527a7e869f9d5ea54c686ab507a849501'.decode('hex')
inbuf.append(StringIO.StringIO(x))
x = '5eb3fcabf808887e8abc9797b065342c7b03b0cecb95759727caad5d41ea696e8942d43446ea8e0835333269de06ee71f06663498d8bf47f56f528729fedf781'.decode('hex')
inbuf.append(StringIO.StringIO(x))

outbuf = StringIO.StringIO()
status = s4_decode(inbuf, outbuf) # Only 2 of 3 shares required for this demo
computed = outbuf.getvalue()
expected = "Too many secrets, Marty!"

# generated by code pyssslib ID 4c51de6e4b26a0332857f71d4c13048b700d32af
if computed == expected and status == True:
	print "compatibility test PASS"
else:
	print "compatibility test FAIL"
