1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-12 16:47:42 -05:00

Move crypto into its own subdirectory.

Similarly to 'utils', I've moved all the stuff in the crypto
build-time library into a source directory of its own, and while I'm
at it, split up the monolithic sshauxcrypt.c into its various
unrelated parts.

This is also an opportunity to remove the annoying 'ssh' prefix from
the front of the file names, and give several of them less cryptic
names.
This commit is contained in:
Simon Tatham
2021-04-18 13:16:59 +01:00
parent 2b26ddf261
commit 5b30e6f7a6
32 changed files with 230 additions and 187 deletions

16
crypto/mac_simple.c Normal file
View File

@ -0,0 +1,16 @@
/*
* Convenience function to MAC a single piece of data, wrapping up
* the faff of making and freeing an ssh_mac.
*/
#include "ssh.h"
void mac_simple(const ssh2_macalg *alg, ptrlen key, ptrlen data, void *output)
{
ssh2_mac *mac = ssh2_mac_new(alg, NULL);
ssh2_mac_setkey(mac, key);
ssh2_mac_start(mac);
put_datapl(mac, data);
ssh2_mac_genresult(mac, output);
ssh2_mac_free(mac);
}