Skip to content

Commit f2f7e7c

Browse files
committed
Throw on truncation in the X25519 and X448 derive bits operation
1 parent 067671c commit f2f7e7c

File tree

1 file changed

+20
-34
lines changed

1 file changed

+20
-34
lines changed

index.html

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,17 @@ <h4>Operations</h4>
167167
</li>
168168
<li>
169169
<dl class="switch">
170-
<dt>If |length| is null:</dt>
171-
<dd>Return |secret|</dd>
172-
<dt>Otherwise:</dt>
170+
<dt>
171+
If |length| is not null, and not equal to the length of |secret| in bits:
172+
</dt>
173+
<dd>
174+
[= exception/throw =] an {{OperationError}}.
175+
</dd>
176+
<dt>
177+
Otherwise:
178+
</dt>
173179
<dd>
174-
<dl class="switch">
175-
<dt>
176-
If the length of |secret| in bits is less than
177-
|length|:
178-
</dt>
179-
<dd>
180-
[= exception/throw =] an
181-
{{OperationError}}.
182-
</dd>
183-
<dt>Otherwise:</dt>
184-
<dd>
185-
Return an <a data-cite="WebCryptoAPI#octet-string-containing">octet string containing</a> the first |length| bits of |secret|.
186-
</dd>
187-
</dl>
180+
Return |secret|.
188181
</dd>
189182
</dl>
190183
</li>
@@ -1019,24 +1012,17 @@ <h4>Operations</h4>
10191012
</li>
10201013
<li>
10211014
<dl class="switch">
1022-
<dt>If |length| is null:</dt>
1023-
<dd>Return |secret|</dd>
1024-
<dt>Otherwise:</dt>
1015+
<dt>
1016+
If |length| is not null, and not equal to the length of |secret| in bits:
1017+
</dt>
1018+
<dd>
1019+
[= exception/throw =] an {{OperationError}}.
1020+
</dd>
1021+
<dt>
1022+
Otherwise:
1023+
</dt>
10251024
<dd>
1026-
<dl class="switch">
1027-
<dt>
1028-
If the length of |secret| in bits is less than
1029-
|length|:
1030-
</dt>
1031-
<dd>
1032-
[= exception/throw =] an
1033-
{{OperationError}}.
1034-
</dd>
1035-
<dt>Otherwise:</dt>
1036-
<dd>
1037-
Return an <a data-cite="WebCryptoAPI#octet-string-containing">octet string containing</a> the first |length| bits of |secret|.
1038-
</dd>
1039-
</dl>
1025+
Return |secret|.
10401026
</dd>
10411027
</dl>
10421028
</li>

0 commit comments

Comments
 (0)