Repository navigation
Commit b505cd5
crypto: support non-byte WebCrypto lengths and cSHAKE
Add shared bit-length helpers for WebCrypto operations that accept bit
sequences whose length is not byte-aligned.
Use the helpers for cSHAKE output, ECDH-derived bits, HMAC/KMAC key
generation/import/derivation, and KMAC sign/verify output. Preserve the
requested bit length in CryptoKey algorithm metadata while storing and
exporting rounded-up byte material with unused low bits cleared.
Keep byte-multiple validation for algorithms whose specs require it.
Extend the lower-end of KMAC's key length support.
Enable cSHAKE customization and functionName parameters.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63988
Backport-PR-URL: #64629
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent 0f54a87 commit b505cd5
29 files changed
Lines changed: 1389 additions & 146 deletions
File tree
- doc/api
- lib/internal/crypto
- src/crypto
- test
- fixtures
- crypto
- webcrypto
- parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1924 | 1924 | | |
1925 | 1925 | | |
1926 | 1926 | | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1927 | 1931 | | |
1928 | 1932 | | |
1929 | 1933 | | |
1930 | 1934 | | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
1935 | 1942 | | |
1936 | 1943 | | |
1937 | 1944 | | |
1938 | 1945 | | |
1939 | 1946 | | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
1940 | 1951 | | |
1941 | 1952 | | |
1942 | 1953 | | |
1943 | 1954 | | |
1944 | | - | |
1945 | | - | |
1946 | | - | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
1947 | 1960 | | |
1948 | 1961 | | |
1949 | 1962 | | |
| |||
2472 | 2485 | | |
2473 | 2486 | | |
2474 | 2487 | | |
2475 | | - | |
2476 | | - | |
2477 | | - | |
| 2488 | + | |
2478 | 2489 | | |
2479 | 2490 | ||