char/avril
(wip) why'd you have to go and make things so complicaaaaated?
git clone https://git.t4t.associates/char/avril
dbb5c40
main
1declare module"ext:core/ops" { 2type CryptoUsage = import ( "./types.js" ). CryptoKeyUsage ; 3type CryptoOperation = import ( "./types.js" ). CryptoOperation ; 4type CryptoFormat = import ( "./types.js" ). CryptoKeyFormat ; 5type CryptoMeta = import ( "./types.js" ). CryptoKeyMetadata ; 6type CryptoBuffer = import ( "./types.js" ). CryptoBuffer ; 7type CryptoView = import ( "./types.js" ). CryptoView ; 8 9export function op_crypto_random ( bytes :CryptoView ) :null ; 10export function op_crypto_uuid ( input :null ) :string ; 11export function op_crypto_key_dispose ( id :number ) :null ; 12export function op_crypto_key_clone ( id :number ) :number ; 13export function op_crypto_key_serialize ( id :number ) :number ; 14export function op_crypto_key_deserialize ( id :number ) :number ; 15export function op_crypto_key_pair_generate ( 16args :[ 17algorithm :string , 18hash :string , 19length :number , 20exponent :CryptoBuffer , 21curve :string , 22usages :CryptoUsage [], 23extractable :boolean , 24], 25) :Promise <[ publicId :number , privateId :number , length :number , exponent :CryptoBuffer | null ]>; 26export function op_crypto_key_generate ( 27args :[ algorithm :string , length :number , hash :string , usages :CryptoUsage [], extractable :boolean ], 28) :Promise < number >; 29export function op_crypto_key_import ( 30args :[ 31algorithm :string , 32bytes :CryptoBuffer , 33length :number , 34hash :string , 35usages :CryptoUsage [], 36extractable :boolean , 37], 38) :Promise < number >; 39export function op_crypto_key_import_asymmetric ( 40args :[ 41format :CryptoFormat , 42data :CryptoBuffer , 43algorithm :string , 44hash :string , 45curve :string , 46usages :CryptoUsage [], 47extractable :boolean , 48], 49) :Promise < CryptoMeta >; 50export function op_crypto_key_import_jwk ( 51args :[ 52jwk :Record < string , unknown >, 53algorithm :string , 54hash :string , 55curve :string , 56usages :CryptoUsage [], 57extractable :boolean , 58length :number , 59], 60) :Promise < CryptoMeta >; 61export function op_crypto_key_export ( args :[ id :number , format :CryptoFormat ]) :Promise < CryptoBuffer >; 62export function op_crypto_key_export_jwk ( id :number ) :Promise < Record < string , unknown >>; 63export function op_crypto_derive_key ( 64args :[ 65id :number , 66hash :string , 67salt :CryptoBuffer , 68iterations :number , 69info :CryptoBuffer , 70length :number , 71algorithm :string , 72keyHash :string , 73usages :CryptoUsage [], 74extractable :boolean , 75peerId :number , 76], 77) :Promise < number >; 78export function op_crypto_wrap_key ( 79args :[ 80wrappingId :number , 81targetId :number , 82format :CryptoFormat , 83algorithm :string , 84hash :string , 85iv :CryptoBuffer , 86counter :CryptoBuffer , 87additional :CryptoBuffer , 88tagLength :number , 89], 90) :Promise < CryptoBuffer >; 91export function op_crypto_unwrap_key ( 92args :[ 93wrappingId :number , 94format :CryptoFormat , 95wrapped :CryptoBuffer , 96algorithm :string , 97hash :string , 98curve :string , 99usages :CryptoUsage [], 100extractable :boolean , 101iv :CryptoBuffer , 102counter :CryptoBuffer , 103additional :CryptoBuffer , 104tagLength :number , 105length :number , 106], 107) :Promise < CryptoMeta >; 108export function op_crypto_run ( 109args :[ 110operation :CryptoOperation , 111id :number , 112hash :string , 113iv :CryptoBuffer , 114counter :CryptoBuffer , 115additional :CryptoBuffer , 116tagLength :number , 117iterations :number , 118salt :CryptoBuffer , 119info :CryptoBuffer , 120input :CryptoBuffer , 121peerId :number , 122], 123) :Promise < CryptoBuffer >; 124export function op_crypto_digest ( args :[ name :string , input :CryptoBuffer ]) :Promise < CryptoBuffer >; 125}