tdes 1.1.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/tdes/tdes_class.c +8 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4c7d3feb6e32a1f02619a86a836301be3ec374c75393766abeaf84416cb3899
4
- data.tar.gz: 701b94549d7de007e86b5995e1153abd56b493a4d67159cc7cae1b116d475df3
3
+ metadata.gz: 3c6c14c10e550e551c174f5f7bb326b1f776f438ad24dad86560bf5c1124213a
4
+ data.tar.gz: c415c650eabd30d776aa3f536be207218c4c666873f5f5c830958995f88d79bc
5
5
  SHA512:
6
- metadata.gz: 186814b8aba4916571262cfec184d93fabfd046ef4ff7abdef27563b4b24c688e5d94b90a9cd85db20c907d85487b38fb1411430b532bd8591d6566e8d8247e9
7
- data.tar.gz: 63184a278bff822ebb4963c9675d4f796bce5a28c83a0858ac2ac5cd59735375220114d3b0586c9c89e14ce27d1b7f01cfca013bb7017c117466ddecbb89ab91
6
+ metadata.gz: 02faa963d70d327db66a18c0879c2af94531a1ca5964d5475ab3668d433b565fa6b3561a2921388267170c746eb48c829b07c961d5b65c8b891cc83250399370
7
+ data.tar.gz: 0a509a2623c042b551a84f049d35217736f19591f22c4e29b0f9c34a6ed045ce104cd762b5f8b669ac172aab92fcabfb0bd115b0100b599e077ecd219e464941
@@ -19,22 +19,17 @@ 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
- err = DES_set_key_checked((void*) raw_key + 16, &key_data->ks3);
26
- if (err) {
27
- rb_raise(rb_eArgError, "Invalid DES key");
28
- }
24
+ DES_set_key_unchecked((void*) raw_key + 0, &key_data->ks1);
25
+ DES_set_key_unchecked((void*) raw_key + 8, &key_data->ks2);
26
+ DES_set_key_unchecked((void*) raw_key + 16, &key_data->ks3);
27
+ break;
28
+
29
29
  case 16:
30
- err = DES_set_key_checked((void*) raw_key + 8, &key_data->ks2);
31
- if (err) {
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
- }
30
+ DES_set_key_unchecked((void*) raw_key + 0, &key_data->ks1);
31
+ DES_set_key_unchecked((void*) raw_key + 8, &key_data->ks2);
32
+ DES_set_key_unchecked((void*) raw_key + 0, &key_data->ks3);
38
33
  break;
39
34
 
40
35
  default:
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: 1.1.0
4
+ version: 2.0.1
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-06 00:00:00.000000000 Z
11
+ date: 2022-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler