@@ -373,14 +373,16 @@ def test_encrypt_boundaries(self):
373373 def test_encrypt_all (self ):
374374 for test in testVectors :
375375 with self .subTest (testVector = test ):
376- c = FF3Cipher (test ['key' ], test ['tweak' ], test ['radix' ])
376+ alphabet = FF3Cipher .NISTTV_BASE62 [0 :test ['radix' ]]
377+ c = FF3Cipher (test ['key' ], test ['tweak' ], alphabet )
377378 s = c .encrypt (test ['plaintext' ])
378379 self .assertEqual (s , test ['ciphertext' ])
379380
380381 def test_decrypt_all (self ):
381382 for test in testVectors :
382383 with self .subTest (testVector = test ):
383- c = FF3Cipher (test ['key' ], test ['tweak' ], test ['radix' ])
384+ alphabet = FF3Cipher .NISTTV_BASE62 [0 :test ['radix' ]]
385+ c = FF3Cipher (test ['key' ], test ['tweak' ], alphabet )
384386 s = c .decrypt (test ['ciphertext' ])
385387 self .assertEqual (s , test ['plaintext' ])
386388
@@ -419,7 +421,7 @@ def test_custom_alphabet(self):
419421 tweak = "D8E7920AFA330A73"
420422 plaintext = "⁸⁹⁰¹²¹²³⁴⁵⁶⁷⁸⁹⁰⁰⁰⁰"
421423 ciphertext = "⁷⁵⁰⁹¹⁸⁸¹⁴⁰⁵⁸⁶⁵⁴⁶⁰⁷"
422- c = FF3Cipher . withCustomAlphabet (key , tweak , alphabet )
424+ c = FF3Cipher (key , tweak , alphabet )
423425 s = c .encrypt (plaintext )
424426 self .assertEqual (s , ciphertext )
425427 x = c .decrypt (s )
@@ -466,7 +468,7 @@ def test_whole_domain(self):
466468 tweak = "D8E7920AFA330A73"
467469 for radix , plaintext_len , alphabet in test_cases :
468470 if alphabet is None :
469- c = FF3Cipher (key , tweak , radix = radix )
471+ c = FF3Cipher . withRadix (key , tweak , radix = radix )
470472 else :
471473 c = FF3Cipher .withCustomAlphabet (key , tweak , alphabet = alphabet )
472474 self .subTest (radix = radix , plaintext_len = plaintext_len )
0 commit comments