{"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,AAAO,YAAY,cAA4B;AAC7C,SAAO;AACP,OAAK,kBAAkB,IAAI,qBAAqB,aAAa;AAC7D,OAAK,SAAS,IAAI,YAAY,KAAK,gBAAgB;;CAGrD,AAAO,gBAAkD,OAAa;AACpE,SAAO,KAAK,gBAAgB,qBAAqB,MAAM;;CAGzD,AAAO,OAAO,WAAmB,MAAgC;AAC/D,SAAO,OAAO,KAAK,IAAI,WAAW,KAAK,EAAE,UAAU,CAAC"}