Current section

Files

Jump to
gossamer src gossamer subtle_crypto wrap_algorithm.ffi.mjs
Raw

src/gossamer/subtle_crypto/wrap_algorithm.ffi.mjs

// src/gossamer/subtle_crypto/wrap_algorithm.ffi.ts
import * as $alg from "./wrap_algorithm.mjs";
function toWrapAlgorithm(algorithm) {
if ($alg.WrapAlgorithm$isOther(algorithm)) {
return $alg.WrapAlgorithm$Other$0(algorithm);
}
if ($alg.WrapAlgorithm$isAesCbc(algorithm)) {
return {
name: "AES-CBC",
iv: $alg.WrapAlgorithm$AesCbc$iv(algorithm)
};
}
if ($alg.WrapAlgorithm$isAesCtr(algorithm)) {
return {
name: "AES-CTR",
counter: $alg.WrapAlgorithm$AesCtr$counter(
algorithm
),
length: $alg.WrapAlgorithm$AesCtr$length(algorithm)
};
}
if ($alg.WrapAlgorithm$isRsaOaepWith(algorithm)) {
return {
name: "RSA-OAEP",
label: $alg.WrapAlgorithm$RsaOaepWith$label(
algorithm
)
};
}
return { name: "RSA-OAEP" };
}
export {
toWrapAlgorithm
};