Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw on truncation in the X25519 and X448 derive bits operation #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 12 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ <h4>Operations</h4>
|key|, then [= exception/throw =] an {{InvalidAccessError}}.
</p>
</li>
<li>
<p>
If |length| is not null, and not equal to 256, then [= exception/throw =] an {{OperationError}}.
</p>
</li>
<li>
<p>
Let |secret| be the result of performing the X25519 function specified in
Expand All @@ -166,27 +171,7 @@ <h4>Operations</h4>
</p>
</li>
<li>
<dl class="switch">
<dt>If |length| is null:</dt>
<dd>Return |secret|</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>
</dd>
</dl>
Return |secret|.
</li>
</ol>
</dd>
Expand Down Expand Up @@ -1002,6 +987,11 @@ <h4>Operations</h4>
|key|, then [= exception/throw =] an {{InvalidAccessError}}.
</p>
</li>
<li>
<p>
If |length| is not null, and not equal to 448, then [= exception/throw =] an {{OperationError}}.
</p>
</li>
<li>
<p>
Let |secret| be the result of performing the X448 function specified in
Expand All @@ -1018,27 +1008,7 @@ <h4>Operations</h4>
</p>
</li>
<li>
<dl class="switch">
<dt>If |length| is null:</dt>
<dd>Return |secret|</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>
</dd>
</dl>
Return |secret|.
</li>
</ol>
</dd>
Expand Down