tdes 1.0.2 → 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 +4 -14
- metadata +2 -2
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,26 +19,16 @@ 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");
|
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");
|
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");
|
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:
|
41
|
-
rb_raise(rb_eArgError, "Invalid DES key length");
|
31
|
+
rb_raise(rb_eArgError, "Invalid DES key length (%ld)", key_length);
|
42
32
|
}
|
43
33
|
|
44
34
|
rb_obj_call_init(self, 0, NULL);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Bastos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|