{"version":3,"file":"CredoWebCrypto.mjs","names":[],"sources":["../../../src/crypto/webcrypto/CredoWebCrypto.ts"],"sourcesContent":["import * as core from 'webcrypto-core'\nimport type { AgentContext } from '../../agent'\nimport { Hasher } from '../hashes'\nimport { CredoSubtle } from './CredoSubtle'\nimport { CredoWalletWebCrypto } from './CredoWalletWebCrypto'\n\nexport class CredoWebCrypto extends core.Crypto {\n  private walletWebCrypto: CredoWalletWebCrypto\n  public subtle: CredoSubtle\n\n  public constructor(agentContext: AgentContext) {\n    super()\n    this.walletWebCrypto = new CredoWalletWebCrypto(agentContext)\n    this.subtle = new CredoSubtle(this.walletWebCrypto)\n  }\n\n  public getRandomValues<T extends ArrayBufferView | null>(array: T): T {\n    return this.walletWebCrypto.generateRandomValues(array)\n  }\n\n  public digest(algorithm: string, data: ArrayBuffer): ArrayBuffer {\n    return Hasher.hash(new Uint8Array(data), algorithm).buffer as ArrayBuffer\n  }\n}\n"],"mappings":";;;;;;AAMA,IAAa,iBAAb,cAAoC,KAAK,OAAO;CAI9C,YAAmB,cAA4B;EAC7C,MAAM;EACN,KAAK,kBAAkB,IAAI,qBAAqB,YAAY;EAC5D,KAAK,SAAS,IAAI,YAAY,KAAK,eAAe;CACpD;CAEA,gBAAyD,OAAa;EACpE,OAAO,KAAK,gBAAgB,qBAAqB,KAAK;CACxD;CAEA,OAAc,WAAmB,MAAgC;EAC/D,OAAO,OAAO,KAAK,IAAI,WAAW,IAAI,GAAG,SAAS,CAAC,CAAC;CACtD;AACF"}