* Adds padding to the end of the given array * * @param {Uint8Array} u8Array Array to pad * @param {number} size Resulting size of the array
(u8Array, size)
| 102 | * @param {number} size Resulting size of the array |
| 103 | */ |
| 104 | function padEnd(u8Array, size) { |
| 105 | const result = new Uint8Array(size) |
| 106 | result.set(u8Array) |
| 107 | result.fill(0, u8Array.length) |
| 108 | |
| 109 | return result |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Pre-processes message to feed the algorithm loop |