key_length_for (crypto/subtle_derive_key.rs)

deno · ext/crypto/subtle_derive_key.rs · rust · MIT
security, tag:knn-classified

Computes derived key lengths and handles key derivation logic for SubtleCrypto.

// Source: https://github.com/denoland/deno | License: MIT | Copyright 2018-2026 the Deno authors
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2018-2026 the Deno authors. MIT license.

//! `SubtleCrypto.deriveKey()` body in Rust.
//!
//! Compose path: validates the `baseKey` algorithm match + `deriveKey`
//! usage, runs the `deriveBits` synchronously off the v8 stack via
//! [`crate::subtle_derive_bits::run`], then mints the derived `CryptoKey`
//! through the Rust `raw-secret` import path
//! ([`crate::subtle_import_key::run`]).

use deno_core::ToV8;
use deno_core::v8;
use deno_error::JsErrorBox;

use crate::CryptoError;
use crate::algorithm::compute_key_length;
use crate::subtle_derive_bits::SubtleDeriveBitsParams;
use crate::subtle_export_key::KeyFormat;

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key