Skip to content

Commit b284c08

Browse files
authored
* Fixed compilation error in test.
1 parent 984789f commit b284c08

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/phelix/test_phelix.adb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
with Ada.Text_IO;
2020
with Crypto.Phelix.Test_Vectors;
21-
with Interfaces;
2221

2322
procedure Test_Phelix with
2423
SPARK_Mode => Off
@@ -65,7 +64,7 @@ begin
6564
declare
6665
use type Crypto.Ciphertext_Stream;
6766
use type Crypto.Plaintext_Stream;
68-
use type Interfaces.Unsigned_32;
67+
use type Crypto.Phelix.MAC_Size_32;
6968

7069
Mac_Len : constant Crypto.Phelix.MAC_Size_32 := 8 * T.MAC.all'Length;
7170
This : Crypto.Phelix.Context;
@@ -133,8 +132,6 @@ begin
133132
end loop;
134133

135134
declare
136-
use type Crypto.Nonce_Stream;
137-
138135
KEY_LENGTH : constant := Crypto.Phelix.Max_Key_Size / 8;
139136
MAC_LENGTH : constant := Crypto.Phelix.Max_MAC_Size / 8;
140137
NONCE_LENGTH : constant := Crypto.Phelix.Max_Nonce_Size / 8;
@@ -148,6 +145,7 @@ begin
148145
use type Crypto.Byte;
149146
use type Crypto.Ciphertext_Stream;
150147
use type Crypto.Key_Stream;
148+
use type Crypto.Nonce_Stream;
151149
use type Crypto.Phelix.MAC_Size_32;
152150

153151
procedure Send_Nonce (Key : in Crypto.Key_Stream;
@@ -235,7 +233,7 @@ begin
235233
-- "Randomly" advance Nonce.
236234
for J in 1 .. Key (Key'First) loop
237235
for K in 1 .. Key (Key'First + 1) loop
238-
Nonce := Nonce + Key (Key'Last);
236+
Nonce := Nonce + Crypto.Nonce_Stream (Key (Key'First .. Key'First + 13) & (14 .. NONCE_LENGTH - 1 => 0));
239237
end loop;
240238
end loop;
241239
end loop;

0 commit comments

Comments
 (0)