You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The methods in SubtleCrypto and the "normalize an algorithm" algorithm
already make a copy of the provided data, there's no need to make
another copy later on in the methods and operations.
Copy file name to clipboardexpand all lines: spec/Overview.html
+41-49
Original file line number
Diff line number
Diff line change
@@ -750,14 +750,6 @@ <h2>Terminology</h2>
750
750
</p>
751
751
</li>
752
752
</ol>
753
-
<p>
754
-
When this specification states to supply the <dfn id="concept-contents-of-arraybuffer">
755
-
contents of an ArrayBuffer</dfn> named |data| to an underlying cryptographic
756
-
implementation, the User Agent shall supply a contiguous sequence of bytes that is equal
757
-
to the result of
758
-
[= get a copy of the buffer source | getting a copy of the bytes =]
759
-
held |data|.
760
-
</p>
761
753
<p>
762
754
When this specification says to calculate the <dfn id="concept-usage-intersection">usage
763
755
intersection</dfn> of two sequences, |a| and |b| the result shall be a
@@ -1416,7 +1408,7 @@ <h4>The encrypt method</h4>
1416
1408
<p>
1417
1409
Let |data| be the result of
1418
1410
[= get a copy of the buffer source |
1419
-
getting a copy of the bytes =] held by the `data` parameter passed to the
1411
+
getting a copy of the bytes held by =] the `data` parameter passed to the
1420
1412
{{SubtleCrypto/encrypt()}} method.
1421
1413
</p>
1422
1414
</li>
@@ -1514,7 +1506,7 @@ <h4>The decrypt method</h4>
1514
1506
<li>
1515
1507
<p>
1516
1508
Let |algorithm| and |key| be the
1517
-
`algorithm` and `key`parameters
1509
+
`algorithm` and `key`parameters
1518
1510
passed to the {{SubtleCrypto/decrypt()}} method,
1519
1511
respectively.
1520
1512
</p>
@@ -3957,7 +3949,7 @@ <h4>Operations</h4>
3957
3949
<li>
3958
3950
<p>
3959
3951
Perform the signature generation operation defined in Section 8.2 of [[RFC3447]] with the key represented by the {{CryptoKey/[[handle]]}} internal slot of |key|
3960
-
as the signer's private key and the <a href="#concept-contents-of-arraybuffer">contents of |message|</a> as
3952
+
as the signer's private key and |message| as
3961
3953
|M| and using the hash function specified in the {{RsaHashedKeyAlgorithm/hash}} attribute of the {{CryptoKey/[[algorithm]]}} internal slot of
3962
3954
|key| as the Hash option for the EMSA-PKCS1-v1_5 encoding method.
3963
3955
</p>
@@ -3997,9 +3989,9 @@ <h4>Operations</h4>
3997
3989
Perform the signature verification operation defined in Section 8.2 of
3998
3990
[[RFC3447]] with the key represented by the
3999
3991
{{CryptoKey/[[handle]]}} internal slot of
4000
-
|key| as the signer's RSA public key and the <a href="#concept-contents-of-arraybuffer">contents of |message|</a> as
4001
-
|M| and the <a href="#concept-contents-of-arraybuffer">contents of
4002
-
|signature|</a> as |S| and using the hash function specified
3992
+
|key| as the signer's RSA public key and |message| as
3993
+
|M| and
3994
+
|signature| as |S| and using the hash function specified
4003
3995
in the {{RsaHashedKeyAlgorithm/hash}} attribute of the
4004
3996
{{CryptoKey/[[algorithm]]}} internal slot of
4005
3997
|key| as the Hash option for the EMSA-PKCS1-v1_5 encoding method.
@@ -4986,7 +4978,7 @@ <h4>Operations</h4>
4986
4978
<li>
4987
4979
<p>
4988
4980
Perform the signature generation operation defined in Section 8.1 of [[RFC3447]] with the key represented by the {{CryptoKey/[[handle]]}} internal slot of |key|
4989
-
as the signer's private key, |K|, and the <a href="#concept-contents-of-arraybuffer">contents of |message|</a> as
4981
+
as the signer's private key, |K|, and |message| as
4990
4982
the message to be signed, |M|, and using the hash function specified
4991
4983
by the {{RsaHashedKeyAlgorithm/hash}} attribute of the
4992
4984
{{CryptoKey/[[algorithm]]}} internal slot of
@@ -5030,9 +5022,9 @@ <h4>Operations</h4>
5030
5022
Perform the signature verification operation defined in Section 8.1 of
5031
5023
[[RFC3447]] with the key represented by the
5032
5024
{{CryptoKey/[[handle]]}} internal slot of
5033
-
|key| as the signer's RSA public key and the <a href="#concept-contents-of-arraybuffer">contents of |message|</a> as
5034
-
|M| and <a href="#concept-contents-of-arraybuffer">the contents of
5035
-
|signature|</a> as |S| and using the hash function specified
5025
+
|key| as the signer's RSA public key and |message| as
5026
+
|M| and
5027
+
|signature| as |S| and using the hash function specified
5036
5028
by the {{RsaHashedKeyAlgorithm/hash}} attribute of the
5037
5029
{{CryptoKey/[[algorithm]]}} internal slot of
5038
5030
|key| as the Hash option, MGF1 (defined in Section B.2.1 of [[RFC3447]]) as the MGF option and the <a href="#dfn-RsaPssParams-saltLength">saltLength</a> member of
@@ -6003,7 +5995,7 @@ <h4>Operations</h4>
6003
5995
</li>
6004
5996
<li>
6005
5997
<p>
6006
-
Let |label| be the <a href="#concept-contents-of-arraybuffer">contents of</a> the {{RsaOaepParams/label}} member of
5998
+
Let |label| be the {{RsaOaepParams/label}} member of
6007
5999
|normalizedAlgorithm| or the empty octet string if the
6008
6000
{{RsaOaepParams/label}} member of
6009
6001
|normalizedAlgorithm| is not present.
@@ -6012,7 +6004,7 @@ <h4>Operations</h4>
6012
6004
<li>
6013
6005
<p>
6014
6006
Perform the encryption operation defined in Section 7.1 of [[RFC3447]] with the key represented by |key|
6015
-
as the recipient's RSA public key, the <a href="#concept-contents-of-arraybuffer">contents of |plaintext|</a>
6007
+
as the recipient's RSA public key, |plaintext|
6016
6008
as the message to be encrypted, |M| and |label|
6017
6009
as the label, |L|, and with the hash
6018
6010
function specified by the {{RsaHashedKeyAlgorithm/hash}}
@@ -6054,7 +6046,7 @@ <h4>Operations</h4>
6054
6046
</li>
6055
6047
<li>
6056
6048
<p>
6057
-
Let |label| be the <a href="#concept-contents-of-arraybuffer">contents of</a> the {{RsaOaepParams/label}} member of
6049
+
Let |label| be the {{RsaOaepParams/label}} member of
6058
6050
|normalizedAlgorithm| or the empty octet string if the
6059
6051
{{RsaOaepParams/label}} member of
6060
6052
|normalizedAlgorithm| is not present.
@@ -6063,7 +6055,7 @@ <h4>Operations</h4>
6063
6055
<li>
6064
6056
<p>
6065
6057
Perform the decryption operation defined in Section 7.1 of [[RFC3447]] with the key represented by |key|
6066
-
as the recipient's RSA private key, the <a href="#concept-contents-of-arraybuffer">contents of |ciphertext|</a>
6058
+
as the recipient's RSA private key, |ciphertext|
6067
6059
as the ciphertext to be decrypted, C, and |label|
6068
6060
as the label, |L|, and with the hash
6069
6061
function specified by the {{RsaHashedKeyAlgorithm/hash}}
@@ -12093,13 +12085,13 @@ <h4>Operations</h4>
12093
12085
<li>
12094
12086
<p>
12095
12087
Let |ciphertext| be the result of performing the CTR Encryption
12096
-
operation described in Section 6.5 of [[NIST-SP800-38A]] using AES as the block cipher, <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesCtrParams/counter}} member of
12088
+
operation described in Section 6.5 of [[NIST-SP800-38A]] using AES as the block cipher, the {{AesCtrParams/counter}} member of
12097
12089
|normalizedAlgorithm| as the initial value of the counter block, the
12098
12090
{{AesCtrParams/length}} member of
12099
12091
|normalizedAlgorithm| as the input parameter |m| to the
12100
12092
standard counter block incrementing function defined in Appendix B.1 of
12101
-
[[NIST-SP800-38A]] and <a href="#concept-contents-of-arraybuffer">the contents of
12102
-
|plaintext|</a> as the input plaintext.
12093
+
[[NIST-SP800-38A]] and
12094
+
|plaintext| as the input plaintext.
12103
12095
</p>
12104
12096
</li>
12105
12097
<li>
@@ -12133,13 +12125,13 @@ <h4>Operations</h4>
12133
12125
<li>
12134
12126
<p>
12135
12127
Let |plaintext| be the result of performing the CTR Decryption
12136
-
operation described in Section 6.5 of [[NIST-SP800-38A]] using AES as the block cipher, <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesCtrParams/counter}} member of
12128
+
operation described in Section 6.5 of [[NIST-SP800-38A]] using AES as the block cipher, the {{AesCtrParams/counter}} member of
12137
12129
|normalizedAlgorithm| as the initial value of the counter block, the
12138
12130
{{AesCtrParams/length}} member of
12139
12131
|normalizedAlgorithm| as the input parameter |m| to the
12140
12132
standard counter block incrementing function defined in Appendix B.1 of
12141
-
[[NIST-SP800-38A]] and <a href="#concept-contents-of-arraybuffer">the contents of
12142
-
|ciphertext|</a> as the input ciphertext.
12133
+
[[NIST-SP800-38A]] and
12134
+
|ciphertext| as the input ciphertext.
12143
12135
</p>
12144
12136
</li>
12145
12137
<li>
@@ -12624,7 +12616,7 @@ <h4>Operations</h4>
12624
12616
<li>
12625
12617
<p>
12626
12618
Let |paddedPlaintext| be the result of adding padding octets to
12627
-
the <a href="#concept-contents-of-arraybuffer">contents of |plaintext|</a>
12619
+
|plaintext|
12628
12620
according to the procedure defined in Section 10.3
12629
12621
of [[RFC2315]], step 2, with a value of
12630
12622
|k| of 16.
@@ -12633,7 +12625,7 @@ <h4>Operations</h4>
12633
12625
<li>
12634
12626
<p>
12635
12627
Let |ciphertext| be the result of performing the CBC Encryption
12636
-
operation described in Section 6.2 of [[NIST-SP800-38A]] using AES as the block cipher, <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesCbcParams/iv}} member of |normalizedAlgorithm| as
12628
+
operation described in Section 6.2 of [[NIST-SP800-38A]] using AES as the block cipher, the {{AesCbcParams/iv}} member of |normalizedAlgorithm| as
12637
12629
the |IV| input parameter and |paddedPlaintext|
12638
12630
as the input plaintext.
12639
12631
</p>
@@ -12660,9 +12652,9 @@ <h4>Operations</h4>
12660
12652
<li>
12661
12653
<p>
12662
12654
Let |paddedPlaintext| be the result of performing the CBC Decryption
12663
-
operation described in Section 6.2 of [[NIST-SP800-38A]] using AES as the block cipher, <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesCbcParams/iv}} member of |normalizedAlgorithm| as
12664
-
the |IV| input parameter and <a href="#concept-contents-of-arraybuffer">the contents of
12665
-
|ciphertext|</a> as the input ciphertext.
12655
+
operation described in Section 6.2 of [[NIST-SP800-38A]] using AES as the block cipher, the {{AesCbcParams/iv}} member of |normalizedAlgorithm| as
12656
+
the |IV| input parameter and
12657
+
|ciphertext| as the input ciphertext.
12666
12658
</p>
12667
12659
</li>
12668
12660
<li>
@@ -13193,7 +13185,7 @@ <h4>Operations</h4>
13193
13185
</li>
13194
13186
<li>
13195
13187
<p>
13196
-
Let |additionalData| be <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesGcmParams/additionalData}} member of
13188
+
Let |additionalData| be the {{AesGcmParams/additionalData}} member of
13197
13189
|normalizedAlgorithm| if present or the empty octet
13198
13190
string otherwise.
13199
13191
</p>
@@ -13202,11 +13194,11 @@ <h4>Operations</h4>
13202
13194
<p>
13203
13195
Let |C| and |T| be the outputs that result from performing
13204
13196
the Authenticated Encryption Function described in Section 7.1 of
13205
-
[[NIST-SP800-38D]] using AES as the block cipher, <a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesGcmParams/iv}} member of |normalizedAlgorithm| as
13206
-
the |IV| input parameter, <a href="#concept-contents-of-arraybuffer">the contents of
13207
-
|additionalData|</a> as the |A| input parameter,
13208
-
|tagLength| as the |t| pre-requisite and <a href="#concept-contents-of-arraybuffer">the contents of
13209
-
|plaintext|</a> as the input plaintext.
13197
+
[[NIST-SP800-38D]] using AES as the block cipher, the {{AesGcmParams/iv}} member of |normalizedAlgorithm| as
13198
+
the |IV| input parameter,
13199
+
|additionalData| as the |A| input parameter,
13200
+
|tagLength| as the |t| pre-requisite and
13201
+
|plaintext| as the input plaintext.
13210
13202
</p>
13211
13203
</li>
13212
13204
<li>
@@ -13282,7 +13274,7 @@ <h4>Operations</h4>
13282
13274
</li>
13283
13275
<li>
13284
13276
<p>
13285
-
Let |additionalData| be <a href="#concept-contents-of-arraybuffer">the contents</a> of the {{AesGcmParams/additionalData}} member of
13277
+
Let |additionalData| be the {{AesGcmParams/additionalData}} member of
13286
13278
|normalizedAlgorithm| if present or the empty octet
13287
13279
string otherwise.
13288
13280
</p>
@@ -13291,11 +13283,11 @@ <h4>Operations</h4>
13291
13283
<p>
13292
13284
Perform the Authenticated Decryption Function described in Section 7.2 of
13293
13285
[[NIST-SP800-38D]] using AES as the block cipher,
13294
-
<a href="#concept-contents-of-arraybuffer">the contents of</a> the {{AesGcmParams/iv}} member of |normalizedAlgorithm| as
13295
-
the |IV| input parameter, <a href="#concept-contents-of-arraybuffer">the contents of
13296
-
|additionalData|</a> as the |A| input parameter,
13297
-
|tagLength| as the |t| pre-requisite, <a href="#concept-contents-of-arraybuffer">the contents of
13298
-
|actualCiphertext|</a> as the input ciphertext, |C| and <a href="#concept-contents-of-arraybuffer">the contents of |tag|</a> as
13286
+
the {{AesGcmParams/iv}} member of |normalizedAlgorithm| as
13287
+
the |IV| input parameter,
13288
+
|additionalData| as the |A| input parameter,
13289
+
|tagLength| as the |t| pre-requisite,
13290
+
|actualCiphertext| as the input ciphertext, |C| and |tag| as
13299
13291
the authentication tag, |T|.
13300
13292
</p>
13301
13293
<dl class="switch">
@@ -15110,13 +15102,13 @@ <h4>Operations</h4>
15110
15102
</li>
15111
15103
<li>
15112
15104
<p>
15113
-
<a href="#concept-contents-of-arraybuffer">the contents of</a> the {{HkdfParams/salt}} member of
15105
+
the {{HkdfParams/salt}} member of
15114
15106
|normalizedAlgorithm| as |salt|,
15115
15107
</p>
15116
15108
</li>
15117
15109
<li>
15118
15110
<p>
15119
-
<a href="#concept-contents-of-arraybuffer">the contents of</a> the {{HkdfParams/info}} member of
15111
+
the {{HkdfParams/info}} member of
15120
15112
|normalizedAlgorithm| as |info|,
15121
15113
</p>
15122
15114
</li>
@@ -15327,8 +15319,8 @@ <h4>Operations</h4>
15327
15319
Let |result| be the result of performing the PBKDF2 operation defined
15328
15320
in Section 5.2 of [[RFC8018]] using |prf| as the
15329
15321
pseudo-random function, |PRF|, the password represented by {{CryptoKey/[[handle]]}} internal slot of |key|
15330
-
as the password, |P|, <a href="#concept-contents-of-arraybuffer">the
15331
-
contents of</a> the {{Pbkdf2Params/salt}} attribute of
15322
+
as the password, |P|,
15323
+
the {{Pbkdf2Params/salt}} attribute of
15332
15324
|normalizedAlgorithm| as the salt, |S|, the value of the {{Pbkdf2Params/iterations}} attribute of
15333
15325
|normalizedAlgorithm| as the iteration count, |c|, and
15334
15326
|length| divided by 8 as the intended key length, |dkLen|.
0 commit comments