tdes 1.0.2 → 2.0.0

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 +4 -14
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51053dd0f4ff7a4df36529d4e50d94b7ae8794295779e8b08ed4ccf085c68885
4
- data.tar.gz: 890f438c8a12b8e4bf39fc09b2b9ced3a629a47d283942dfbb6a8346769288c4
3
+ metadata.gz: 5cddfd30668bdad791c32854d5f95a48f4aec801af4a12e97bcfe8fae8ea1cd8
4
+ data.tar.gz: 54cf93e8fd85596f4e03dc7be34ed12799522d0f3ceb1af9e25b930b6f873658
5
5
  SHA512:
6
- metadata.gz: fdf4e69baf621c783bf6d96f99c5740891a49284b8adace88369229b01b2337b4db46da37b7f00cca4917375c5766c6f3faf145fea3ffc5f85cd2909ed1275d3
7
- data.tar.gz: bca0eba1feb9a310443e1607217ae51a5597cc64d454b4e00f0b0c21fb06543eb1eac1daac6ce074c0ae7a54805020a58bb2edc5d5993505568d2cd693700fd2
6
+ metadata.gz: 53819b240e65d3a46e1c0fe3e73b5f81b5ddcd4533a9f2b94125e4ec76a2511b98193c980a2dafa595dfe04368ffd3ad827ab920e92955d9e6b7725410c7f299
7
+ data.tar.gz: ee16aff6d21f5060e0607574c947d158deb6872a7baf6b449a34383ee9107b72fa333af0e213fb25d2c58e1e4b2d776b93092685b769683e391857d20c0483a7
@@ -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
- 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 + 16, &key_data->ks3);
29
25
  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
- }
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: 1.0.2
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-04 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler