]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - ssh.h
SHA-256 implementation, for use in future KEX algorithms, in particular
[PuTTY.git] / ssh.h
diff --git a/ssh.h b/ssh.h
index 09ee167a1a11197c3dcf896c91b9804078feb5ba..45405d3e9b97f8a010159f8ddd621597d7389963 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -122,6 +122,16 @@ void SHA_Simple(void *p, int len, unsigned char *output);
 
 void hmac_sha1_simple(void *key, int keylen, void *data, int datalen,
                      unsigned char *output);
+typedef struct {
+    uint32 h[8];
+    unsigned char block[64];
+    int blkused;
+    uint32 lenhi, lenlo;
+} SHA256_State;
+void SHA256_Init(SHA256_State * s);
+void SHA256_Bytes(SHA256_State * s, const void *p, int len);
+void SHA256_Final(SHA256_State * s, unsigned char *output);
+void SHA256_Simple(const void *p, int len, unsigned char *output);
 
 typedef struct {
     uint64 h[8];
@@ -245,6 +255,7 @@ extern const struct ssh2_ciphers ssh2_aes;
 extern const struct ssh2_ciphers ssh2_blowfish;
 extern const struct ssh2_ciphers ssh2_arcfour;
 extern const struct ssh_hash ssh_sha1;
+extern const struct ssh_hash ssh_sha256;
 extern const struct ssh_kex ssh_diffiehellman_group1;
 extern const struct ssh_kex ssh_diffiehellman_group14;
 extern const struct ssh_kex ssh_diffiehellman_gex;