git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit ba77ac1e2d88b72126fa0495b28fecd821ca118c

Standardized on stdint's uint_* types; cleanup.

Removed a fair bit of #if 0'd debug code which we don't need.
Coda Hale committed on 9/16/2009, 7:39:54 PM
Parent: 525b5999142d3d8c731fd7524eb07780dcd03720

Files changed

ext/mri/bcrypt.cchanged
ext/mri/bcrypt.hchanged
ext/mri/bcrypt_ext.cchanged
ext/mri/blf.hchanged
ext/mri/blowfish.cchanged
ext/mri/extconf.rbchanged
ext/mri/bcrypt.cView
@@ -1,7 +1,11 @@
11 /* $OpenBSD: bcrypt.c,v 1.22 2007/02/20 01:44:16 ray Exp $ */
22
3-/*
3+/*
4+ * Modified by <coda.hale@gmail.com> on 2009-09-16:
5+ *
6+ * - Standardized on stdint.h's numerical types and removed some debug cruft.
7+ *
48 * Modified by <hongli@phusion.nl> on 2009-08-05:
59 *
610 * - Got rid of the global variables; they're not thread-safe.
711 * Modified the functions to accept local buffers instead.
@@ -57,15 +61,10 @@
5761 * 6. RETURN Concatenate (salt, ctext);
5862 *
5963 */
6064
61-#if 0
6265 #include <stdio.h>
63-#endif
64-
65-#include <stdio.h>
6666 #include <stdlib.h>
67-#include <sys/types.h>
6867 #include <string.h>
6968 #include "blf.h"
7069 #include "bcrypt.h"
7170
@@ -73,16 +72,16 @@
7372 * You can have up to 2^31 rounds which should be enough for some
7473 * time to come.
7574 */
7675
77-static void encode_salt(char *, u_int8_t *, u_int16_t, u_int8_t);
78-static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t);
79-static void decode_base64(u_int8_t *, u_int16_t, u_int8_t *);
76+static void encode_salt(char *, uint8_t *, uint16_t, uint8_t);
77+static void encode_base64(uint8_t *, uint8_t *, uint16_t);
78+static void decode_base64(uint8_t *, uint16_t, uint8_t *);
8079
81-const static u_int8_t Base64Code[] =
80+const static uint8_t Base64Code[] =
8281 "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
8382
84-const static u_int8_t index_64[128] = {
83+const static uint8_t index_64[128] = {
8584 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
8685 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
8786 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
8887 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
@@ -98,13 +97,13 @@
9897 };
9998 #define CHAR64(c) ( (c) > 127 ? 255 : index_64[(c)])
10099
101100 static void
102-decode_base64(u_int8_t *buffer, u_int16_t len, u_int8_t *data)
101+decode_base64(uint8_t *buffer, uint16_t len, uint8_t *data)
103102 {
104- u_int8_t *bp = buffer;
105- u_int8_t *p = data;
106- u_int8_t c1, c2, c3, c4;
103+ uint8_t *bp = buffer;
104+ uint8_t *p = data;
105+ uint8_t c1, c2, c3, c4;
107106 while (bp < buffer + len) {
108107 c1 = CHAR64(*p);
109108 c2 = CHAR64(*(p + 1));
110109
@@ -133,26 +132,26 @@
133132 }
134133 }
135134
136135 static void
137-encode_salt(char *salt, u_int8_t *csalt, u_int16_t clen, u_int8_t logr)
136+encode_salt(char *salt, uint8_t *csalt, uint16_t clen, uint8_t logr)
138137 {
139138 salt[0] = '$';
140139 salt[1] = BCRYPT_VERSION;
141140 salt[2] = 'a';
142141 salt[3] = '$';
143142
144143 snprintf(salt + 4, 4, "%2.2u$", logr);
145144
146- encode_base64((u_int8_t *) salt + 7, csalt, clen);
145+ encode_base64((uint8_t *) salt + 7, csalt, clen);
147146 }
148147 /* Generates a salt for this version of crypt.
149148 Since versions may change. Keeping this here
150149 seems sensible.
151150 */
152151
153152 char *
154-bcrypt_gensalt(char *output, u_int8_t log_rounds, u_int8_t *rseed)
153+bcrypt_gensalt(char *output, uint8_t log_rounds, uint8_t *rseed)
155154 {
156155 if (log_rounds < 4)
157156 log_rounds = 4;
158157 else if (log_rounds > 31)
@@ -167,14 +166,14 @@
167166 char *
168167 bcrypt(char *output, const char *key, const char *salt)
169168 {
170169 blf_ctx state;
171- u_int32_t rounds, i, k;
172- u_int16_t j;
173- u_int8_t key_len, salt_len, logr, minor;
174- u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt";
175- u_int8_t csalt[BCRYPT_MAXSALT];
176- u_int32_t cdata[BCRYPT_BLOCKS];
170+ uint32_t rounds, i, k;
171+ uint16_t j;
172+ uint8_t key_len, salt_len, logr, minor;
173+ uint8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt";
174+ uint8_t csalt[BCRYPT_MAXSALT];
175+ uint32_t cdata[BCRYPT_BLOCKS];
177176 int n;
178177
179178 /* Discard "$" identifier */
180179 salt++;
@@ -207,10 +206,10 @@
207206 /* Computer power doesn't increase linear, 2^x should be fine */
208207 n = atoi(salt);
209208 if (n > 31 || n < 0)
210209 return NULL;
211- logr = (u_int8_t)n;
212- if ((rounds = (u_int32_t) 1 << logr) < BCRYPT_MINROUNDS)
210+ logr = (uint8_t)n;
211+ if ((rounds = (uint32_t) 1 << logr) < BCRYPT_MINROUNDS)
213212 return NULL;
214213
215214 /* Discard num rounds + "$" identifier */
216215 salt += 3;
@@ -218,18 +217,18 @@
218217 if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT)
219218 return NULL;
220219
221220 /* We dont want the base64 salt but the raw data */
222- decode_base64(csalt, BCRYPT_MAXSALT, (u_int8_t *) salt);
221+ decode_base64(csalt, BCRYPT_MAXSALT, (uint8_t *) salt);
223222 salt_len = BCRYPT_MAXSALT;
224223 key_len = strlen(key) + (minor >= 'a' ? 1 : 0);
225224
226225 /* Setting up S-Boxes and Subkeys */
227226 Blowfish_initstate(&state);
228227 Blowfish_expandstate(&state, csalt, salt_len,
229- (u_int8_t *) key, key_len);
228+ (uint8_t *) key, key_len);
230229 for (k = 0; k < rounds; k++) {
231- Blowfish_expand0state(&state, (u_int8_t *) key, key_len);
230+ Blowfish_expand0state(&state, (uint8_t *) key, key_len);
232231 Blowfish_expand0state(&state, csalt, salt_len);
233232 }
234233
235234 /* This can be precomputed later */
@@ -260,20 +259,20 @@
260259 output[i++] = '$';
261260
262261 snprintf(output + i, 4, "%2.2u$", logr);
263262
264- encode_base64((u_int8_t *) output + i + 3, csalt, BCRYPT_MAXSALT);
265- encode_base64((u_int8_t *) output + strlen(output), ciphertext,
263+ encode_base64((uint8_t *) output + i + 3, csalt, BCRYPT_MAXSALT);
264+ encode_base64((uint8_t *) output + strlen(output), ciphertext,
266265 4 * BCRYPT_BLOCKS - 1);
267266 return output;
268267 }
269268
270269 static void
271-encode_base64(u_int8_t *buffer, u_int8_t *data, u_int16_t len)
270+encode_base64(uint8_t *buffer, uint8_t *data, uint16_t len)
272271 {
273- u_int8_t *bp = buffer;
274- u_int8_t *p = data;
275- u_int8_t c1, c2;
272+ uint8_t *bp = buffer;
273+ uint8_t *p = data;
274+ uint8_t c1, c2;
276275 while (p < data + len) {
277276 c1 = *p++;
278277 *bp++ = Base64Code[(c1 >> 2)];
279278 c1 = (c1 & 0x03) << 4;
@@ -295,34 +294,4 @@
295294 *bp++ = Base64Code[c2 & 0x3f];
296295 }
297296 *bp = '\0';
298297 }
299-#if 0
300-void
301-main()
302-{
303- char blubber[73];
304- char salt[100];
305- char *p;
306- salt[0] = '$';
307- salt[1] = BCRYPT_VERSION;
308- salt[2] = '$';
309-
310- snprintf(salt + 3, 4, "%2.2u$", 5);
311-
312- printf("24 bytes of salt: ");
313- fgets(salt + 6, sizeof(salt) - 6, stdin);
314- salt[99] = 0;
315- printf("72 bytes of password: ");
316- fpurge(stdin);
317- fgets(blubber, sizeof(blubber), stdin);
318- blubber[72] = 0;
319-
320- p = crypt(blubber, salt);
321- printf("Passwd entry: %s\n\n", p);
322-
323- p = bcrypt_gensalt(5);
324- printf("Generated salt: %s\n", p);
325- p = crypt(blubber, p);
326- printf("Passwd entry: %s\n", p);
327-}
328-#endif
ext/mri/bcrypt.hView
@@ -30,8 +30,10 @@
3030
3131 #ifndef _BCRYPT_H_
3232 #define _BCRYPT_H_
3333
34+#include <stdint.h>
35+
3436 #define BCRYPT_VERSION '2'
3537 #define BCRYPT_MAXSALT 16 /* Precomputation is just so nice */
3638 #define BCRYPT_BLOCKS 6 /* Ciphertext blocks */
3739 #define BCRYPT_MINROUNDS 16 /* we have log2(rounds) in salt */
@@ -48,9 +50,9 @@
4850 * rseed: a seed of BCRYPT_MAXSALT bytes. Should be obtained from a
4951 * cryptographically secure random source.
5052 * Returns: output
5153 */
52-char *bcrypt_gensalt(char *output, u_int8_t log_rounds, u_int8_t *rseed);
54+char *bcrypt_gensalt(char *output, uint8_t log_rounds, uint8_t *rseed);
5355
5456 /*
5557 * Given a secret and a salt, generates a salted hash (which you can then store safely).
5658 *
ext/mri/bcrypt_ext.cView
@@ -40,9 +40,9 @@
4040 static VALUE bc_salt(VALUE self, VALUE cost, VALUE seed) {
4141 int icost = NUM2INT(cost);
4242 char salt[BCRYPT_SALT_OUTPUT_SIZE];
4343
44- bcrypt_gensalt(salt, icost, (u_int8_t *)RSTRING_PTR(seed));
44+ bcrypt_gensalt(salt, icost, (uint8_t *)RSTRING_PTR(seed));
4545 return rb_str_new2(salt);
4646 }
4747
4848 /* Given a secret and a salt, generates a salted hash (which you can then store safely).
ext/mri/blf.hView
@@ -30,20 +30,13 @@
3030 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3131 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232 */
3333
34-/* Add this type so we'll compile nicely on Solaris.
35- Thanks to Jeremy LaTrasse and the Twitter crew. */
36-#ifdef __sun
37- #define u_int8_t uint8_t
38- #define u_int16_t uint16_t
39- #define u_int32_t uint32_t
40- #define u_int64_t uint64_t
41-#endif
42-
4334 #ifndef _BLF_H_
4435 #define _BLF_H_
4536
37+#include <stdint.h>
38+
4639 // Imported from pwd.h. <coda.hale@gmail.com>
4740 #define _PASSWORD_LEN 128 /* max length, not counting NUL */
4841
4942 /* Schneier specifies a maximum key length of 56 bytes.
@@ -57,37 +50,37 @@
5750 #define BLF_MAXKEYLEN ((BLF_N-2)*4) /* 448 bits */
5851
5952 /* Blowfish context */
6053 typedef struct BlowfishContext {
61- u_int32_t S[4][256]; /* S-Boxes */
62- u_int32_t P[BLF_N + 2]; /* Subkeys */
54+ uint32_t S[4][256]; /* S-Boxes */
55+ uint32_t P[BLF_N + 2]; /* Subkeys */
6356 } blf_ctx;
6457
6558 /* Raw access to customized Blowfish
6659 * blf_key is just:
6760 * Blowfish_initstate( state )
6861 * Blowfish_expand0state( state, key, keylen )
6962 */
7063
71-void Blowfish_encipher(blf_ctx *, u_int32_t *, u_int32_t *);
72-void Blowfish_decipher(blf_ctx *, u_int32_t *, u_int32_t *);
64+void Blowfish_encipher(blf_ctx *, uint32_t *, uint32_t *);
65+void Blowfish_decipher(blf_ctx *, uint32_t *, uint32_t *);
7366 void Blowfish_initstate(blf_ctx *);
74-void Blowfish_expand0state(blf_ctx *, const u_int8_t *, u_int16_t);
67+void Blowfish_expand0state(blf_ctx *, const uint8_t *, uint16_t);
7568 void Blowfish_expandstate
76-(blf_ctx *, const u_int8_t *, u_int16_t, const u_int8_t *, u_int16_t);
69+(blf_ctx *, const uint8_t *, uint16_t, const uint8_t *, uint16_t);
7770
7871 /* Standard Blowfish */
7972
80-void blf_key(blf_ctx *, const u_int8_t *, u_int16_t);
81-void blf_enc(blf_ctx *, u_int32_t *, u_int16_t);
82-void blf_dec(blf_ctx *, u_int32_t *, u_int16_t);
73+void blf_key(blf_ctx *, const uint8_t *, uint16_t);
74+void blf_enc(blf_ctx *, uint32_t *, uint16_t);
75+void blf_dec(blf_ctx *, uint32_t *, uint16_t);
8376
84-void blf_ecb_encrypt(blf_ctx *, u_int8_t *, u_int32_t);
85-void blf_ecb_decrypt(blf_ctx *, u_int8_t *, u_int32_t);
77+void blf_ecb_encrypt(blf_ctx *, uint8_t *, uint32_t);
78+void blf_ecb_decrypt(blf_ctx *, uint8_t *, uint32_t);
8679
87-void blf_cbc_encrypt(blf_ctx *, u_int8_t *, u_int8_t *, u_int32_t);
88-void blf_cbc_decrypt(blf_ctx *, u_int8_t *, u_int8_t *, u_int32_t);
80+void blf_cbc_encrypt(blf_ctx *, uint8_t *, uint8_t *, uint32_t);
81+void blf_cbc_decrypt(blf_ctx *, uint8_t *, uint8_t *, uint32_t);
8982
90-/* Converts u_int8_t to u_int32_t */
91-u_int32_t Blowfish_stream2word(const u_int8_t *, u_int16_t , u_int16_t *);
83+/* Converts uint8_t to uint32_t */
84+uint32_t Blowfish_stream2word(const uint8_t *, uint16_t , uint16_t *);
9285
9386 #endif
ext/mri/blowfish.cView
@@ -38,14 +38,8 @@
3838 * Blowfish is an unpatented fast block cipher designed by
3939 * Bruce Schneier.
4040 */
4141
42-#if 0
43-#include <stdio.h> /* used for debugging */
44-#include <string.h>
45-#endif
46-
47-#include <sys/types.h>
4842 #include "blf.h"
4943
5044 #undef inline
5145 #ifdef __GNUC__
@@ -63,14 +57,14 @@
6357
6458 #define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n])
6559
6660 void
67-Blowfish_encipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr)
61+Blowfish_encipher(blf_ctx *c, uint32_t *xl, uint32_t *xr)
6862 {
69- u_int32_t Xl;
70- u_int32_t Xr;
71- u_int32_t *s = c->S[0];
72- u_int32_t *p = c->P;
63+ uint32_t Xl;
64+ uint32_t Xr;
65+ uint32_t *s = c->S[0];
66+ uint32_t *p = c->P;
7367
7468 Xl = *xl;
7569 Xr = *xr;
7670
@@ -88,14 +82,14 @@
8882 *xr = Xl;
8983 }
9084
9185 void
92-Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr)
86+Blowfish_decipher(blf_ctx *c, uint32_t *xl, uint32_t *xr)
9387 {
94- u_int32_t Xl;
95- u_int32_t Xr;
96- u_int32_t *s = c->S[0];
97- u_int32_t *p = c->P;
88+ uint32_t Xl;
89+ uint32_t Xr;
90+ uint32_t *s = c->S[0];
91+ uint32_t *p = c->P;
9892
9993 Xl = *xl;
10094 Xr = *xr;
10195
@@ -391,15 +385,15 @@
391385
392386 *c = initstate;
393387 }
394388
395-u_int32_t
396-Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes,
397- u_int16_t *current)
389+uint32_t
390+Blowfish_stream2word(const uint8_t *data, uint16_t databytes,
391+ uint16_t *current)
398392 {
399- u_int8_t i;
400- u_int16_t j;
401- u_int32_t temp;
393+ uint8_t i;
394+ uint16_t j;
395+ uint32_t temp;
402396
403397 temp = 0x00000000;
404398 j = *current;
405399
@@ -413,16 +407,16 @@
413407 return temp;
414408 }
415409
416410 void
417-Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes)
411+Blowfish_expand0state(blf_ctx *c, const uint8_t *key, uint16_t keybytes)
418412 {
419- u_int16_t i;
420- u_int16_t j;
421- u_int16_t k;
422- u_int32_t temp;
423- u_int32_t datal;
424- u_int32_t datar;
413+ uint16_t i;
414+ uint16_t j;
415+ uint16_t k;
416+ uint32_t temp;
417+ uint32_t datal;
418+ uint32_t datar;
425419
426420 j = 0;
427421 for (i = 0; i < BLF_N + 2; i++) {
428422 /* Extract 4 int8 to 1 int32 from keystream */
@@ -451,17 +445,17 @@
451445 }
452446
453447
454448 void
455-Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes,
456- const u_int8_t *key, u_int16_t keybytes)
449+Blowfish_expandstate(blf_ctx *c, const uint8_t *data, uint16_t databytes,
450+ const uint8_t *key, uint16_t keybytes)
457451 {
458- u_int16_t i;
459- u_int16_t j;
460- u_int16_t k;
461- u_int32_t temp;
462- u_int32_t datal;
463- u_int32_t datar;
452+ uint16_t i;
453+ uint16_t j;
454+ uint16_t k;
455+ uint32_t temp;
456+ uint32_t datal;
457+ uint32_t datar;
464458
465459 j = 0;
466460 for (i = 0; i < BLF_N + 2; i++) {
467461 /* Extract 4 int8 to 1 int32 from keystream */
@@ -494,9 +488,9 @@
494488
495489 }
496490
497491 void
498-blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len)
492+blf_key(blf_ctx *c, const uint8_t *k, uint16_t len)
499493 {
500494 /* Initialize S-boxes and subkeys with Pi */
501495 Blowfish_initstate(c);
502496
@@ -504,12 +498,12 @@
504498 Blowfish_expand0state(c, k, len);
505499 }
506500
507501 void
508-blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks)
502+blf_enc(blf_ctx *c, uint32_t *data, uint16_t blocks)
509503 {
510- u_int32_t *d;
511- u_int16_t i;
504+ uint32_t *d;
505+ uint16_t i;
512506
513507 d = data;
514508 for (i = 0; i < blocks; i++) {
515509 Blowfish_encipher(c, d, d + 1);
@@ -517,12 +511,12 @@
517511 }
518512 }
519513
520514 void
521-blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks)
515+blf_dec(blf_ctx *c, uint32_t *data, uint16_t blocks)
522516 {
523- u_int32_t *d;
524- u_int16_t i;
517+ uint32_t *d;
518+ uint16_t i;
525519
526520 d = data;
527521 for (i = 0; i < blocks; i++) {
528522 Blowfish_decipher(c, d, d + 1);
@@ -530,12 +524,12 @@
530524 }
531525 }
532526
533527 void
534-blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len)
528+blf_ecb_encrypt(blf_ctx *c, uint8_t *data, uint32_t len)
535529 {
536- u_int32_t l, r;
537- u_int32_t i;
530+ uint32_t l, r;
531+ uint32_t i;
538532
539533 for (i = 0; i < len; i += 8) {
540534 l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
541535 r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7];
@@ -552,12 +546,12 @@
552546 }
553547 }
554548
555549 void
556-blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len)
550+blf_ecb_decrypt(blf_ctx *c, uint8_t *data, uint32_t len)
557551 {
558- u_int32_t l, r;
559- u_int32_t i;
552+ uint32_t l, r;
553+ uint32_t i;
560554
561555 for (i = 0; i < len; i += 8) {
562556 l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
563557 r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7];
@@ -574,12 +568,12 @@
574568 }
575569 }
576570
577571 void
578-blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len)
572+blf_cbc_encrypt(blf_ctx *c, uint8_t *iv, uint8_t *data, uint32_t len)
579573 {
580- u_int32_t l, r;
581- u_int32_t i, j;
574+ uint32_t l, r;
575+ uint32_t i, j;
582576
583577 for (i = 0; i < len; i += 8) {
584578 for (j = 0; j < 8; j++)
585579 data[j] ^= iv[j];
@@ -599,13 +593,13 @@
599593 }
600594 }
601595
602596 void
603-blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len)
597+blf_cbc_decrypt(blf_ctx *c, uint8_t *iva, uint8_t *data, uint32_t len)
604598 {
605- u_int32_t l, r;
606- u_int8_t *iv;
607- u_int32_t i, j;
599+ uint32_t l, r;
600+ uint8_t *iv;
601+ uint32_t i, j;
608602
609603 iv = data + len - 16;
610604 data = data + len - 8;
611605 for (i = len - 8; i >= 8; i -= 8) {
@@ -638,48 +632,4 @@
638632 data[7] = r & 0xff;
639633 for (j = 0; j < 8; j++)
640634 data[j] ^= iva[j];
641635 }
642-
643-#if 0
644-void
645-report(u_int32_t data[], u_int16_t len)
646-{
647- u_int16_t i;
648- for (i = 0; i < len; i += 2)
649- printf("Block %0hd: %08lx %08lx.\n",
650- i / 2, data[i], data[i + 1]);
651-}
652-void
653-main(void)
654-{
655-
656- blf_ctx c;
657- char key[] = "AAAAA";
658- char key2[] = "abcdefghijklmnopqrstuvwxyz";
659-
660- u_int32_t data[10];
661- u_int32_t data2[] =
662- {0x424c4f57l, 0x46495348l};
663-
664- u_int16_t i;
665-
666- /* First test */
667- for (i = 0; i < 10; i++)
668- data[i] = i;
669-
670- blf_key(&c, (u_int8_t *) key, 5);
671- blf_enc(&c, data, 5);
672- blf_dec(&c, data, 1);
673- blf_dec(&c, data + 2, 4);
674- printf("Should read as 0 - 9.\n");
675- report(data, 10);
676-
677- /* Second test */
678- blf_key(&c, (u_int8_t *) key2, strlen(key2));
679- blf_enc(&c, data2, 1);
680- printf("\nShould read as: 0x324ed0fe 0xf413a203.\n");
681- report(data2, 2);
682- blf_dec(&c, data2, 1);
683- report(data2, 2);
684-}
685-#endif
ext/mri/extconf.rbView
@@ -11,8 +11,7 @@
1111 exit 0
1212 else
1313 require "mkmf"
1414 dir_config("bcrypt_ext")
15- # enable this when we're feeling nitpicky
16- # CONFIG['CC'] << " -Wall "
15+ CONFIG['CC'] << " -Wall "
1716 create_makefile("bcrypt_ext")
1817 end

Built with git-ssb-web