Current section

Files

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

src/gossamer/subtle_crypto/key_gen_algorithm.ffi.mjs

// src/gossamer/subtle_crypto/key_gen_algorithm.ffi.ts
import * as $alg from "./key_gen_algorithm.mjs";
import { toAesAlgorithm } from "../aes_algorithm.ffi.mjs";
import { toHashAlgorithm } from "../hash_algorithm.ffi.mjs";
function toKeyGenAlgorithm(algorithm) {
if ($alg.KeyGenAlgorithm$isOther(algorithm)) {
return $alg.KeyGenAlgorithm$Other$0(algorithm);
}
if ($alg.KeyGenAlgorithm$isAes(algorithm)) {
return {
name: toAesAlgorithm($alg.KeyGenAlgorithm$Aes$name(algorithm)),
length: $alg.KeyGenAlgorithm$Aes$length(algorithm)
};
}
return {
name: "HMAC",
hash: toHashAlgorithm($alg.KeyGenAlgorithm$HmacGen$hash(algorithm))
};
}
export {
toKeyGenAlgorithm
};