コード例 #1
0
def tuak_testset_61():
    K = b'\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab'
    RAND = b'BBBBBBBBBBBBBBBB'
    SQN = b'\x11\x11\x11\x11\x11\x11'
    AMF = b'\xff\xff'
    TOP = b'UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 64
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return TOPc == b'\xbd\x04\xd9S\x0e\x87Q<]\x83z\xc2\xad\x95F#\xa8\xe23\x0c\x11S\x05\xa7>\xb4]\x1f@\xcc\xcb\xff' and \
    tuak.f1(K, RAND, SQN, AMF) == b'\xf9\xa5Nj\xea\xa8a\x8d' and \
    tuak.f1star(K, RAND, SQN, AMF) == b'\xe9KM\xc6\xc7)}\xf3'
コード例 #2
0
def tuak_testset_72():
    K = b'\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0\xef\xee\xed\xec\xeb\xea\xe9\xe8\xe7\xe6\xe5\xe4\xe3\xe2\xe1\xe0'
    RAND = b'\x01#Eg\x89\xab\xcd\xef\x01#Eg\x89\xab\xcd\xef'
    TOP = b'\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f'

    tuak = TUAK(TOP)
    tuak.LEN_CK = 128
    tuak.LEN_IK = 128
    tuak.LEN_RES = 64
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return tuak.f2345(K, RAND) == (b'\xe9\xd7I\xdcN\xea\x005', b"\xa4\xcboe)\xab\x17\xf83\x7f'\xba\xa8#MG",
        b'"t\x15\\\xcfA\x99\xd5\xe2\xab\xcb\xf6!\x90\x7f\x90', b'H\n\x93E\xcc\x1e') and \
        tuak.f5star(K, RAND) == b'\xf8N\xb38\x84\x8c'
コード例 #3
0
def tuak_testset_64():
    K = b'\xb8\xda\x83zPe-j\xc7\xc9}\xa1Oj\xcca'
    RAND = b'h\x87\xe5T%\xa9f\xbd\x86\xc9f\x1a_\xa7+\xe8'
    SQN = b'\r\xea.\xe2\xc5\xaf'
    AMF = b'\xdf\x1e'
    TOP = b'\tR\xbe\x13Ul2\xeb\xc5\x81\x95\xd9\xdd\x93\x04\x93\xe1*\x90\x03f\x99\x88\xff\xde_\xa1\xf0\xfe5\xcc\x01'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 128
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return TOPc == b"+\xc1n\xb6W\xa6\x8e\x1fDo\x08\xf5|\x0e\xfb\x1dI5'\xa2\xe6R\xce(\x1e\xb6\xca\x0eD\x87v\n" and \
    tuak.f1(K, RAND, SQN, AMF) == b't\x92\x14\x08yX\xdd\x8fX\xbf\xcd\xf8i\xd8\xae?' and \
    tuak.f1star(K, RAND, SQN, AMF) == b'a\x9e\x86Z\xfe\x80\xe3\x82\xae\xe10c\xf9\xdf\xb5m'
コード例 #4
0
def tuak_testset_71():
    K = b'\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab\xab'
    RAND = b'BBBBBBBBBBBBBBBB'
    TOP = b'UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU'

    tuak = TUAK(TOP)
    tuak.LEN_CK = 128
    tuak.LEN_IK = 128
    tuak.LEN_RES = 32
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return tuak.f2345(K, RAND) == (b'ez\xcdd', b'\xd7\x1a\x1e\\l\xaf\xfe\x98j&\xf7\x83\xe5\xc7\x8b\xe1',
        b'\xbe\x84\x9f\xa2VO\x86\x9a\xec\xeeob\xd43~r', b'q\x9f\x1e\x9b\x90T') and \
        tuak.f5star(K, RAND) == b'\xe7\xafk=\x0e8'
コード例 #5
0
def tuak_testset_65():
    K = b'\x15t\xcaV\x88\x1d\x05\xc1\x89\xc8(\x80\xf7\x89\xc9\xcdBD\x95_D&\xaa+i\xc2\x9f\x15w\x0eZ\xa5'
    RAND = b'\xc5p\xaa\xc6\x8c\xdee\x1f\xb1\xe3\x08\x83"I\x8b\xef'
    SQN = b'\xc8\x9b\xb7\x1f:A'
    AMF = b')}'
    TOP = b'\xe5\x9fn\xb1\x0e\xa4\x06\x81?I\x91\xb0\xb9\xe0/\x18\x1e\xdfL~\x17\xb4\x80\xf6m4\xda5\xee\x88\xc9^'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 64
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return TOPc == b'<`R\xe4\x152\xa2\x8aG\xaa<\xbb\x89\xf2#\xe8\xf3\xaa\xa9v\xae\xcdH\xbc>}ae\xa5^\xffb' and \
    tuak.f1(K, RAND, SQN, AMF) == b'\xd74\r\xad\x02\xb4\xcb\x01' and \
    tuak.f1star(K, RAND, SQN, AMF) == b'\xc6\x02\x1e.f\xac\xcb\x15'
コード例 #6
0
def tuak_testset_63():
    K = b'\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0\xef\xee\xed\xec\xeb\xea\xe9\xe8\xe7\xe6\xe5\xe4\xe3\xe2\xe1\xe0'
    RAND = b'\x01#Eg\x89\xab\xcd\xef\x01#Eg\x89\xab\xcd\xef'
    SQN = b'\x01#Eg\x89\xab'
    AMF = b'\xab\xcd'
    TOP = b'\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 256
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return TOPc == b'0T%B~\x18\xc5\x03\xc8\xa4\xb2\x94\xear\xc9]\x0c6\xc6\xc6\xb2\x9d\x0ce\xdeYt\xd5\x97\x7f\x85$' and \
    tuak.f1(K, RAND, SQN, AMF) == b"\xd9{u\xa1w`e'\x1b\x1e!+\xc3\xb1\xbf\x17?C\x8b!\xe6\xc6JU\xa9l7.\x08^\\\xc5" and \
    tuak.f1star(K, RAND, SQN, AMF) == b'B{\xbf\x07\xc6\xe3\xa8lT\xf8\xc5!d\x99\xf3\x90\x9ao\xd4\xa1d\xc9\xfe#[\x15P%\x81\x11\xb8!'
コード例 #7
0
def tuak_testset_62():
    K = b'\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0\xef\xee\xed\xec\xeb\xea\xe9\xe8\xe7\xe6\xe5\xe4\xe3\xe2\xe1\xe0'
    RAND = b'\x01#Eg\x89\xab\xcd\xef\x01#Eg\x89\xab\xcd\xef'
    SQN = b'\x01#Eg\x89\xab'
    AMF = b'\xab\xcd'
    TOP = b'\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 128
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return TOPc == b'0T%B~\x18\xc5\x03\xc8\xa4\xb2\x94\xear\xc9]\x0c6\xc6\xc6\xb2\x9d\x0ce\xdeYt\xd5\x97\x7f\x85$' and \
    tuak.f1(K, RAND, SQN, AMF) == b'\xc0\xb8\xc2\xd4\x14\x8e\xc7\xaa_\x1dx\xa9~M\x1dX' and \
    tuak.f1star(K, RAND, SQN, AMF) == b'\xef\x81\xafr\x90\xf7\x84,l\xea\xfaS\x7f\xa0t['
コード例 #8
0
ファイル: test_TUAK.py プロジェクト: mrlnc/CryptoMobile
def tuak_testset_74():
    K    = b'\xb8\xda\x83zPe-j\xc7\xc9}\xa1Oj\xcca'
    RAND = b'h\x87\xe5T%\xa9f\xbd\x86\xc9f\x1a_\xa7+\xe8'
    TOP  = b'\tR\xbe\x13Ul2\xeb\xc5\x81\x95\xd9\xdd\x93\x04\x93\xe1*\x90\x03f\x99\x88\xff\xde_\xa1\xf0\xfe5\xcc\x01'
    
    tuak = TUAK(TOP)
    tuak.LEN_CK  = 128
    tuak.LEN_IK  = 128
    tuak.LEN_RES = 128
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)
    
    return tuak.f2345(K, RAND) == (b'@A\xceC\x8e>8\xe8\xaa\x96V.\xed\x83\xacC',
        b">;\xc0\x1b\xea\x0c\xd9\x14\xc4\xc2\xc8<\xe2\xd9'W", b'fj\x8eoW{\x1a\xa7{\x7f\xd5<\xeb\xb8\xa3\xd6',
        b'\x1f\x88\r\x00Q\x19') and tuak.f5star(K, RAND) == b'E\xe6\x17\xd7\x7f\xe5'
コード例 #9
0
ファイル: test_TUAK.py プロジェクト: mrlnc/CryptoMobile
def tuak_testset_73():
    K    = b'\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0\xef\xee\xed\xec\xeb\xea\xe9\xe8\xe7\xe6\xe5\xe4\xe3\xe2\xe1\xe0'
    RAND = b'\x01#Eg\x89\xab\xcd\xef\x01#Eg\x89\xab\xcd\xef'
    TOP  = b'\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f'
    
    tuak = TUAK(TOP)
    tuak.LEN_CK  = 128
    tuak.LEN_IK  = 256
    tuak.LEN_RES = 64
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)
    
    return tuak.f2345(K, RAND) == (b'\x07\x02\x1cs\xe7c\\}', b'MY\xacyh4\xeb\x85\xd1\x1f\xa1H\xa5\x05\x8c<',
        b'\x12mGP\x016\xfd\xc5\xdd\xfd\x14\xf1\x9e\xbf\x16t\x9c\xe4\xb6CS#\xfb\xb5qZ:yj`\x82\xbd',
        b'\x1df"\xc4\xe5\x9a') and tuak.f5star(K, RAND) == b'\xf8N\xb38\x84\x8c'
コード例 #10
0
def tuak_testset_75():
    K = b'\x15t\xcaV\x88\x1d\x05\xc1\x89\xc8(\x80\xf7\x89\xc9\xcdBD\x95_D&\xaa+i\xc2\x9f\x15w\x0eZ\xa5'
    RAND = b'\xc5p\xaa\xc6\x8c\xdee\x1f\xb1\xe3\x08\x83"I\x8b\xef'
    TOP = b'\xe5\x9fn\xb1\x0e\xa4\x06\x81?I\x91\xb0\xb9\xe0/\x18\x1e\xdfL~\x17\xb4\x80\xf6m4\xda5\xee\x88\xc9^'

    tuak = TUAK(TOP)
    tuak.LEN_CK = 256
    tuak.LEN_IK = 128
    tuak.LEN_RES = 256
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    return tuak.f2345(K, RAND) == (b'\x84\xd8\x9bA\xdb\x18g\xff\xd4\xc7\xba\x1d\x82\x16?MRj \xfb\xaeT\x18\xfb\xb5&\x94\x0b\x1e\xeb\x90\\',
        b"\xd4\x19gj\xfeZ\xb5\x8c\x1d\x8b\xee\rCR:M/R\xef\x0b1\xa4gj\x0c3D'\xa9\x88\xfee",
        b' U3\xe5\x05f\x1ba\xd0\\\xc0\xea\xc8x\x18\xf4', b'\xd7\xb3\xd2\xd4\x98\n') and \
        tuak.f5star(K, RAND) == b'\xca\x96U&I\x86'
コード例 #11
0
def tuak_testset_66():
    TUAK.KeccakIterations = 2
    K = b'\x15t\xcaV\x88\x1d\x05\xc1\x89\xc8(\x80\xf7\x89\xc9\xcdBD\x95_D&\xaa+i\xc2\x9f\x15w\x0eZ\xa5'
    RAND = b'\xc5p\xaa\xc6\x8c\xdee\x1f\xb1\xe3\x08\x83"I\x8b\xef'
    SQN = b'\xc8\x9b\xb7\x1f:A'
    AMF = b')}'
    TOP = b'\xe5\x9fn\xb1\x0e\xa4\x06\x81?I\x91\xb0\xb9\xe0/\x18\x1e\xdfL~\x17\xb4\x80\xf6m4\xda5\xee\x88\xc9^'

    tuak = TUAK(TOP)
    tuak.LEN_MAC = 256
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)

    ret = ( TOPc == b'\xb0Jf\xf2lb\xfc\xd6\xc8-\xe2*\x17\x9a\xb6U\x06\xec\xf4\x7fV$\\\xd1I\x96l\xfa\x9c\xeczQ' and \
    tuak.f1(K, RAND, SQN, AMF) == b'\x90\xd2(\x9e\xd1\xca\x1c=\xbc"G\xbbH\rC\x1a\xc7\x1d.Jvw\xf6\xe9\x97\xcf\xdd\xb0\xcb\xad\x88\xb7' and \
    tuak.f1star(K, RAND, SQN, AMF) == b'BsU\xdb\xac0\xe8%\x06:\xbaa\xb5V\xe8u\x83\xab\xacc\x8e:\xb0\x1cL\x88J\xd9\xd4X\xdc/' )

    TUAK.KeccakIterations = 1
    return ret
コード例 #12
0
ファイル: test_TUAK.py プロジェクト: mrlnc/CryptoMobile
def tuak_testset_76():
    TUAK.KeccakIterations = 2
    K    = b'\x15t\xcaV\x88\x1d\x05\xc1\x89\xc8(\x80\xf7\x89\xc9\xcdBD\x95_D&\xaa+i\xc2\x9f\x15w\x0eZ\xa5'
    RAND = b'\xc5p\xaa\xc6\x8c\xdee\x1f\xb1\xe3\x08\x83"I\x8b\xef'
    TOP  = b'\xe5\x9fn\xb1\x0e\xa4\x06\x81?I\x91\xb0\xb9\xe0/\x18\x1e\xdfL~\x17\xb4\x80\xf6m4\xda5\xee\x88\xc9^'
    
    tuak = TUAK(TOP)
    tuak.LEN_CK  = 256
    tuak.LEN_IK  = 256
    tuak.LEN_RES = 256
    TOPc = make_TOPc(K, TOP)
    tuak.set_topc(TOPc)
    
    ret = tuak.f2345(K, RAND) == (b'\xd6~ndY\r"\xee\xcb\xa72J\xfaJ\xf4F\x0c\x93\xf0\x1b$Pmn\x12\x04}x\x9a\x94\xc8g',
        b'\xed\xe5~\xdf\xc5|\xdf\xfe\x1a\xaeu\x06j\x1bty\xbb\xc3\x83t8\xe8\x8d7\xa8\x01\xcc\xcc\x9f\x97+\x89',
        b'H\xed\x92\x99\x12nPW@/\xe0\x1f\x92\x01\xcf%$\x9f\x9c\\\x0e\xd2\xaf\xcf\x08GU\xda\xff\x1d9\x99',
        b'j\xae\x8d\x18\xc4H') and tuak.f5star(K, RAND) == b'\x8c_3\xb6\x1fN'
    
    TUAK.KeccakIterations = 1
    return ret