(_algorithm, message)
| 102 | } |
| 103 | |
| 104 | async decrypt(_algorithm, message) { |
| 105 | if (message.length !== this._keyBytes) { |
| 106 | return null; |
| 107 | } |
| 108 | const msgBigInt = u8ArrayToBigInt(message); |
| 109 | const emBigInt = modPow(msgBigInt, this._dBigInt, this._nBigInt); |
| 110 | const em = bigIntToU8Array(emBigInt, this._keyBytes); |
| 111 | if (em[0] !== 0x00 || em[1] !== 0x02) { |
| 112 | return null; |
| 113 | } |
| 114 | let i = 2; |
| 115 | for (; i < em.length; i++) { |
| 116 | if (em[i] === 0x00) { |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | if (i === em.length) { |
| 121 | return null; |
| 122 | } |
| 123 | return em.slice(i + 1, em.length); |
| 124 | } |
| 125 | |
| 126 | async exportKey() { |
| 127 | if (!this._extractable) { |
nothing calls this directly
no test coverage detected