| 1 | // Copyright ©2025 blackshirt. |
| 2 | // Use of this source code is governed by an MIT license |
| 3 | // that can be found in the LICENSE file. |
| 4 | // |
| 5 | import encoding.hex |
| 6 | import x.crypto.ascon |
| 7 | |
| 8 | // The material was generated from https://hashing.tools/ascon/ascon-hash |
| 9 | fn main() { |
| 10 | msg := 'Example of hash256 message'.bytes() |
| 11 | // expected output generated from the tool |
| 12 | digest := hex.decode('0889515a9cfe28ab3a43882884d5933bb74aa09f3c767f8c699b5d7114811340')! |
| 13 | |
| 14 | out := ascon.sum256(msg) |
| 15 | dump(out == digest) // out == digest: true |
| 16 | } |
| 17 | |