Displaying 4 results from an estimated 4 matches for "sha_ctx".
Did you mean:
sha1_ctx
2020 Feb 09
2
[RFC PATCH] Add SHA1 support
..._DigestInit_ex(_ctx, EVP_sha1(), NULL)
+
+#define mdlib_update(_ctx, _buf, _len) EVP_DigestUpdate(_ctx, _buf, _len)
+#define mdlib_finalize(_ctx, _out) EVP_DigestFinal_ex(_ctx, _out, NULL)
+
+#else
+
+#include "lib/sha1.h"
+
+struct md_lib_ctx {
+ int mode;
+ union {
+ md_context md5;
+ SHA_CTX sha1;
+ };
+};
+
void md5_begin(md_context *ctx);
void md5_update(md_context *ctx, const uchar *input, uint32 length);
void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN]);
-void get_md5(uchar digest[MD5_DIGEST_LEN], const uchar *input, int n);
+void sha1_begin(SHA_CTX *ctx);
+void s...
2002 Dec 14
2
[LLVMdev] really long time to compile
...84.8% 0+0k 0+0io 1050pf+0w
% ls -l sha24.o
-rw-r--r-- 1 brg brg 5784 2002-12-14 07:43 sha24.o
The problem goes away if I use -S:
% time llvm-gcc -S sha24.c
0.060u 0.010s 0:00.09 77.7% 0+0k 0+0io 548pf+0w
--
gaeke at uiuc.edu
-------------- next part --------------
struct sha_ctx
{
unsigned int A;
unsigned int B;
unsigned int C;
unsigned int D;
unsigned int E;
unsigned int total[2];
unsigned int buflen;
char buffer[128];
};
void
sha_process_block (const void *buffer, unsigned long len, struct sha_ctx *ctx)
{
const unsigned int *words = buffer;
unsigned l...
2000 Jul 02
2
``portability'' patch for OpenSSH S/Key support
...0
+++ auth-skey.c Sun Jul 2 15:17:47 2000
@@ -4,7 +4,7 @@
#include "ssh.h"
#include "packet.h"
-#include <sha1.h>
+#include <openssl/sha.h>
/* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */
@@ -74,7 +74,6 @@
size_t secretlen = 0;
SHA_CTX ctx;
char *p, *u;
- char md[SHA_DIGEST_LENGTH];
/*
* Base first 4 chars of seed on hostname.
@@ -99,7 +98,7 @@
SHA1_Init(&ctx);
SHA1_Update(&ctx, username, strlen(username));
- SHA1_End(&ctx, up);
+ SHA1_Final(up, &ctx);
/* Collapse the hash */
ptr = hash_...
2008 Apr 21
3
FIPS 140-2 OpenSSL(2007) patches
...}
+#endif
if (c == NULL || c->number != SSH_CIPHER_SSH2) {
debug("bad cipher %s [%s]", p, names);
xfree(cipher_list);
@@ -291,9 +300,25 @@
cipher_set_key_string(CipherContext *cc, Cipher *cipher,
const char *passphrase, int do_encrypt)
{
+#ifdef OPENSSL_FIPS
+ SHA_CTX sha;
+#endif
MD5_CTX md;
- u_char digest[16];
+ u_char digest[20];
+#ifdef OPENSSL_FIPS
+ if (fips_mode) {
+ SHA1_Init(&sha);
+ SHA1_Update(&sha, (const u_char *)passphrase, strlen(passphrase));
+ SHA1_Final(digest, &sha);
+
+ cipher_init(cc, cipher, digest, 20, NULL, 0, do_enc...