Understanding-the-code
In this page we are going to explain/describe the coherence's code, this code is built with the help of:
- It defines (with preprocessor) which algorithms are going to supported
- It defines info_log structure to store the log data
- It defines params structure to help to parse json data and share it with the functions
In this file is main function. We create a tcp server with libuv, validate the input, create the logs output and send the client's input to be parsed.
- main() displays the banner, create the tcp server, starts the event loop and call on_new_connection()
- on_new_connection() accepts the clients, calls alloc_buffer() and on_read()
- alloc_buffer() creates the buffer to store client's input
- on_read() reads data from socket, starts t
- if (nread < 0) an error on reading socket data
- if (nread >= 0) data is read, creates log info, validate the buffer with ok_buff(),if the buffer isn't ok close the connection, if the buffer is ok sends the input to PARSING() , writes the answer, parse_log cleans the log structure and prints the log.
- PARSING() parse the json input with Parsingjson() ,and address the algorithm to its functions
- parse_log parse the log, basically delete sensitive information like private keys with Clear2json()
In this file we can find functions to validate inputs from json client input.
Functions to process argon2 requests
Functions to process block cipher requests
Functions to process Diffie-Hellman requests
Functions to process DSA requests
Functions to process Elliptic Curves requests
Functions to process HASh requests
Functions to process MAC requests
Functions to process NTRU requests
Functions to process Post Quantum Algorithms requests
Functions to process Rand numbers generation requests
Functions to process RSA requests
Functions to process Stream Ciphers requests
Last modified 2yr ago