Devessier / ssl

Clone of openssl in C for 42 School
GNU General Public License v3.0
0 stars 0 forks source link

Implement Base64 command #26

Closed Devessier closed 3 years ago

Devessier commented 3 years ago

We implemented Base64 command and dissociated the command itself from the algorithms encoding and decoding input, in order to use them elsewhere. This will be useful to output keys generated from DES or RSA algorithms.

We created a t_writer struct to write efficiently to a file descriptor, using an internal buffer of 4096 bytes. Once this buffer is full, we flush it. We can also flush the writer explicitly, when a computing process has ended, to be sure everything has been written correctly. The t_writter can also be used to format the output and break lines after a certain characters count.

The t_reader struct can now be used alongside with a predicate skipper function, to skip characters that are not meaningful. In Base64 decoding command it is used to skip space characters, as they are meaningless.

Closes #24