Skip to content

Commit

Permalink
more test cases in test_roundtrip of encrypter decrypter
Browse files Browse the repository at this point in the history
  • Loading branch information
SmithSamuelM committed Aug 6, 2024
1 parent 2b9ba15 commit 8872e63
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions tests/core/test_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,6 @@ def test_decrypter():
assert desalter.qb64b == saltqb64b
assert desalter.code == MtrDex.Salt_128



""" Done Test """

def test_roundtrip():
Expand All @@ -1237,8 +1235,38 @@ def test_roundtrip():
assert encrypter.raw == pubkey


# Test cipher qb2 (always L0 when qb2)
# Test cipher qb64 lead 0
plain = "The quick brown fox jumps over the lazy "
tin = core.Texter(text=plain) # texter in
# create cipher using Encrypter
cipher = encrypter.encrypt(prim=tin, code=CiXDex.X25519_Cipher_QB64_L0)
assert cipher.code == CiXDex.X25519_Cipher_QB64_L0
# decrypt cipher using Decrypter
tout = decrypter.decrypt(cipher=cipher, klas=core.Texter) # texter out
assert tout.text == tin.text

# Test cipher qb64 lead 1
plain = "The quick brown fox jumps over the lazy dogcats"
tin = core.Texter(text=plain) # texter in
# create cipher using Encrypter
cipher = encrypter.encrypt(prim=tin, code=CiXDex.X25519_Cipher_QB64_L0)
assert cipher.code == CiXDex.X25519_Cipher_QB64_L1
# decrypt cipher using Decrypter
tout = decrypter.decrypt(cipher=cipher, klas=core.Texter) # texter out
assert tout.text == tin.text

# Test cipher qb64 lead 2
plain = "The quick brown fox jumps over the lazy dog"
tin = core.Texter(text=plain) # texter in
# create cipher using Encrypter
cipher = encrypter.encrypt(prim=tin, code=CiXDex.X25519_Cipher_QB64_L0)
assert cipher.code == CiXDex.X25519_Cipher_QB64_L2
# decrypt cipher using Decrypter
tout = decrypter.decrypt(cipher=cipher, klas=core.Texter) # texter out
assert tout.text == tin.text


# Test cipher qb2 (always L0 when qb2)
plain = "The quick brown fox jumps over the lazy dog"
tin = core.Texter(text=plain) # texter in
# create cipher using Encrypter
Expand Down

0 comments on commit 8872e63

Please sign in to comment.