@@ -19,7 +19,7 @@ import Random
19
19
return String (buff)
20
20
end
21
21
test_str = " this_is_test_str"
22
- @test ToyPublicKeys . pass_trough_GMP (test_str) == " this_is_test_str"
22
+ @test pass_trough_GMP (test_str) == " this_is_test_str"
23
23
end
24
24
25
25
@testset " power_crt" begin
34
34
35
35
@testset " RSAStep(RSAStep) is identity ~ BigInt" begin
36
36
Random. seed! (42 )
37
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
37
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
38
38
msg = big " 2"
39
39
encrypted = ToyPublicKeys. RSAStep (msg, public_key)
40
40
decrypted = ToyPublicKeys. RSAStep (encrypted, private_key)
43
43
44
44
@testset " RSAStep(RSAStep) is identity ~ CodeUnits" begin
45
45
Random. seed! (42 )
46
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
46
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
47
47
msg = codeunits (" 2" )
48
48
encrypted = ToyPublicKeys. RSAStep (msg, public_key)
49
49
decrypted = ToyPublicKeys. RSAStep (encrypted, private_key)
52
52
53
53
@testset " RSAStep(RSAStep) is identity ~ String" begin
54
54
Random. seed! (42 )
55
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
55
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
56
56
msg = " 2"
57
57
encrypted = ToyPublicKeys. RSAStep (msg, public_key)
58
58
decrypted = ToyPublicKeys. RSAStep (encrypted, private_key)
72
72
73
73
@testset " Decryption(Encryption) is identity ~ CodeUnits" begin
74
74
Random. seed! (42 )
75
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
75
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
76
76
msg = Base. CodeUnits (" 1" )
77
77
encrypted = ToyPublicKeys. encrypt (msg, public_key; pad_length = 1 )
78
78
decrypted = ToyPublicKeys. decrypt (encrypted, private_key)
81
81
82
82
@testset " Decryption(Encryption) is identity ~ String" begin
83
83
Random. seed! (42 )
84
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
84
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
85
85
msg = " 1"
86
86
encrypted = ToyPublicKeys. encrypt (msg, public_key; pad_length = 1 )
87
87
decrypted = ToyPublicKeys. decrypt (encrypted, private_key)
90
90
91
91
@testset " verify_signature(sign) is true ~ String" begin
92
92
Random. seed! (42 )
93
- private_key, public_key = ToyPublicKeys. generate_RSAKeyPair (2048 )
93
+ private_key, public_key = ToyPublicKeys. generate_rsa_key_pair (2048 )
94
94
msg = " 1"
95
95
signature = ToyPublicKeys. sign (msg, private_key; pad_length = 1 )
96
96
@test ToyPublicKeys. verify_signature (msg, signature, public_key)
0 commit comments