Skip to content

Commit

Permalink
Throw on truncation in the X25519 and X448 derive bits operation
Browse files Browse the repository at this point in the history
  • Loading branch information
javifernandez committed Sep 30, 2024
1 parent 067671c commit f2f7e7c
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,17 @@ <h4>Operations</h4>
</li>
<li>
<dl class="switch">
<dt>If |length| is null:</dt>
<dd>Return |secret|</dd>
<dt>Otherwise:</dt>
<dt>
If |length| is not null, and not equal to the length of |secret| in bits:
</dt>
<dd>
[= exception/throw =] an {{OperationError}}.
</dd>
<dt>
Otherwise:
</dt>
<dd>
<dl class="switch">
<dt>
If the length of |secret| in bits is less than
|length|:
</dt>
<dd>
[= exception/throw =] an
{{OperationError}}.
</dd>
<dt>Otherwise:</dt>
<dd>
Return an <a data-cite="WebCryptoAPI#octet-string-containing">octet string containing</a> the first |length| bits of |secret|.
</dd>
</dl>
Return |secret|.
</dd>
</dl>
</li>
Expand Down Expand Up @@ -1019,24 +1012,17 @@ <h4>Operations</h4>
</li>
<li>
<dl class="switch">
<dt>If |length| is null:</dt>
<dd>Return |secret|</dd>
<dt>Otherwise:</dt>
<dt>
If |length| is not null, and not equal to the length of |secret| in bits:
</dt>
<dd>
[= exception/throw =] an {{OperationError}}.
</dd>
<dt>
Otherwise:
</dt>
<dd>
<dl class="switch">
<dt>
If the length of |secret| in bits is less than
|length|:
</dt>
<dd>
[= exception/throw =] an
{{OperationError}}.
</dd>
<dt>Otherwise:</dt>
<dd>
Return an <a data-cite="WebCryptoAPI#octet-string-containing">octet string containing</a> the first |length| bits of |secret|.
</dd>
</dl>
Return |secret|.
</dd>
</dl>
</li>
Expand Down

0 comments on commit f2f7e7c

Please sign in to comment.