z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \
w = rol(w, 30);
+static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
+
+static void SHA1Init(SHA1_CTX *context);
+
+static void SHA1Update(SHA1_CTX *context, const unsigned char *data, uint32_t len);
+
+static void SHA1Final(unsigned char digest[20], SHA1_CTX *context);
+
+
/* Hash a single 512-bit block. This is the core of the algorithm. */
-void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) {
+static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) {
uint32_t a, b, c, d, e;
typedef union {
/* SHA1Init - Initialize new context */
-void SHA1Init(SHA1_CTX *context) {
+static void SHA1Init(SHA1_CTX *context) {
/* SHA1 initialization constants */
context->state[0] = 0x67452301;
context->state[1] = 0xEFCDAB89;
/* Run your data through this. */
-void SHA1Update(SHA1_CTX *context, const unsigned char *data, uint32_t len) {
+static void SHA1Update(SHA1_CTX *context, const unsigned char *data, uint32_t len) {
uint32_t i;
uint32_t j;
/* Add padding and return the message digest. */
-void SHA1Final(unsigned char digest[20], SHA1_CTX *context) {
+static void SHA1Final(unsigned char digest[20], SHA1_CTX *context) {
unsigned i;
unsigned char finalcount[8];
memset(&finalcount, '\0', sizeof(finalcount));
}
-void SHA1(char *hash_out, const char *str, int len) {
+void builtin_SHA1(char *hash_out, const char *str, int len) {
SHA1_CTX ctx;
int ii;
unsigned char buffer[64];
} SHA1_CTX;
-void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
-
-void SHA1Init(SHA1_CTX *context);
-
-void SHA1Update(SHA1_CTX *context, const unsigned char *data, uint32_t len);
-
-void SHA1Final(unsigned char digest[20], SHA1_CTX *context);
-
-void SHA1(char *hash_out, const char *str, int len);
+void builtin_SHA1(char *hash_out, const char *str, int len);
#endif /* SHA1_H */
snprintf(buf, sizeof(buf), "%s" WS_UUID, ws_key);
- SHA1(digest, buf, strlen(buf));
+ builtin_SHA1(digest, buf, strlen(buf));
Base64encode(out, digest, sizeof(digest));
return out;
}