src/sha.h

Sun, 17 Oct 2004 23:55:49 +0000

author
Sean Egan <seanegan@pidgin.im>
date
Sun, 17 Oct 2004 23:55:49 +0000
changeset 10108
0897c42d6cb9
parent 9713
bb37562302a1
permissions
-rw-r--r--

[gaim-migrate @ 11141]
Two things:
a. Added Enter as a gtk_binding to GtkIMHtml. This fixes everything.
Input methods now work. The "Enter sends" and "Ctrl-Enter sends" preferences
were removed and defaulted to yes and no respectively, BUT, in a very super-cool
turn of events, you can now add your own bindings to .gtkrc to make WHATEVER
YOU WANT send. Awesome. Someone should use g_signal_accumulator_true_handled
or something to make profiles and away messages able to insert newlines.

b. Removed "Use multi-colored screennames in chats," defaulted to yes, and
wrote a nifty algorithm to automatically adjust the colors to accomodate the
background (see http://gaim.sf.net/sean/porn-chat.png). People should play
around and tweak it a bit. The algorithm takes into consideration the
luminosity of the current background and the base hue to use for the screenname
in generating the new colors. Note that it does this while maintaining the hues.
Someone should optimize this so it skips over the floating point arithmatic when
the background color is white.

8907
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
1 /*
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
2 * The contents of this file are subject to the Mozilla Public
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
3 * License Version 1.1 (the "License"); you may not use this file
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
4 * except in compliance with the License. You may obtain a copy of
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
5 * the License at http://www.mozilla.org/MPL/
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
6 *
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
7 * Software distributed under the License is distributed on an "AS
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
9 * implied. See the License for the specific language governing
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
10 * rights and limitations under the License.
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
11 *
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
12 * The Original Code is SHA 180-1 Reference Implementation (Compact version)
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
13 *
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
14 * The Initial Developer of the Original Code is Paul Kocher of
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
15 * Cryptography Research. Portions created by Paul Kocher are
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
16 * Copyright (C) 1995-9 by Cryptography Research, Inc. All
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
17 * Rights Reserved.
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
18 *
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
19 * Contributor(s):
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
20 *
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
21 */
9713
bb37562302a1 [gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents: 8907
diff changeset
22 #ifndef _GAIM_SHA_H_
bb37562302a1 [gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents: 8907
diff changeset
23 #define _GAIM_SHA_H_
8907
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
24
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
25 #include <glib.h>
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
26
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
27 typedef struct {
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
28 guint32 H[5];
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
29 guint32 W[80];
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
30 int lenW;
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
31 guint32 sizeHi;
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
32 guint32 sizeLo;
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
33 } SHA_CTX;
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
34
6987
1dd7385875c6 [gaim-migrate @ 7543]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
35 int strprintsha(char *dest, int *hashval);
1dd7385875c6 [gaim-migrate @ 7543]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
36 void shaInit(SHA_CTX *ctx);
1dd7385875c6 [gaim-migrate @ 7543]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
37 void shaUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len);
1dd7385875c6 [gaim-migrate @ 7543]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
38 void shaFinal(SHA_CTX *ctx, unsigned char hashout[20]);
1dd7385875c6 [gaim-migrate @ 7543]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
39 void shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]);
8907
17b9da22de1e [gaim-migrate @ 9677]
Gary Kramlich <grim@pidgin.im>
parents: 6987
diff changeset
40
9713
bb37562302a1 [gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents: 8907
diff changeset
41 #endif /* _GAIM_SHA_H_ */

mercurial