tdes 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/tdes/tdes_class.c +3 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cddfd30668bdad791c32854d5f95a48f4aec801af4a12e97bcfe8fae8ea1cd8
|
4
|
+
data.tar.gz: 54cf93e8fd85596f4e03dc7be34ed12799522d0f3ceb1af9e25b930b6f873658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53819b240e65d3a46e1c0fe3e73b5f81b5ddcd4533a9f2b94125e4ec76a2511b98193c980a2dafa595dfe04368ffd3ad827ab920e92955d9e6b7725410c7f299
|
7
|
+
data.tar.gz: ee16aff6d21f5060e0607574c947d158deb6872a7baf6b449a34383ee9107b72fa333af0e213fb25d2c58e1e4b2d776b93092685b769683e391857d20c0483a7
|
data/ext/tdes/tdes_class.c
CHANGED
@@ -19,22 +19,12 @@ VALUE tdes_new(VALUE class, VALUE key) {
|
|
19
19
|
rb_raise(rb_eRuntimeError, "Failed to setup internal data");
|
20
20
|
}
|
21
21
|
|
22
|
-
int err;
|
23
22
|
switch (key_length) {
|
24
23
|
case 24:
|
25
|
-
|
26
|
-
if (err) {
|
27
|
-
rb_raise(rb_eArgError, "Invalid DES key: %s", err == -1 ? "parity" : "weak");
|
28
|
-
}
|
24
|
+
DES_set_key_unchecked((void*) raw_key + 16, &key_data->ks3);
|
29
25
|
case 16:
|
30
|
-
|
31
|
-
|
32
|
-
rb_raise(rb_eArgError, "Invalid DES key: %s", err == -1 ? "parity" : "weak");
|
33
|
-
}
|
34
|
-
err = DES_set_key_checked((void*) raw_key + 0, &key_data->ks1);
|
35
|
-
if (err) {
|
36
|
-
rb_raise(rb_eArgError, "Invalid DES key: %s", err == -1 ? "parity" : "weak");
|
37
|
-
}
|
26
|
+
DES_set_key_unchecked((void*) raw_key + 8, &key_data->ks2);
|
27
|
+
DES_set_key_unchecked((void*) raw_key + 0, &key_data->ks1);
|
38
28
|
break;
|
39
29
|
|
40
30
|
default:
|