crypto-toolbox 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 466b866a98ec3be521f61b4097c2c4346b301d6e
4
- data.tar.gz: 6840f6e1882fd69e48a5d3bed909020cbfbd1089
3
+ metadata.gz: 3c529ed8b701c009002b4b9403f64034576b5af9
4
+ data.tar.gz: 7769523cf65f54fecc8e2f3e920a96d2bed93594
5
5
  SHA512:
6
- metadata.gz: 68768144aae70032acc66b9dc7b1e247421cacb717c9b4f39857ef649eec2fb71b1ceb76a76b999e23a6a76cf77d7ace9c874c6f012cb406328ff41453d1234b
7
- data.tar.gz: 11bc83467a87b7bb4bb3d862e458037ff0644144b9ace18fab2c4f79782ee99010a8438dd781d0c7f25a3a36868733f9b87439e8e057555b6b39b576aea8b779
6
+ metadata.gz: 28b5161e37b409bfae0d46955e3aa51b5ab8761157911314752e149d1aa0785a84dfb529b4b8cb0f8fd7c5812772996a8effef468f432ee6f98e3f65f85333c8
7
+ data.tar.gz: 714d3cfb1302dee2e227246bf83ff082218db3a5c74dc4d697f72ebf917a893f6bb3c107f77a3f0d6a60587f798c311c18b0c008789595869bd9d53414251e39
@@ -21,7 +21,7 @@ class CryptBuffer
21
21
 
22
22
  include Enumerable
23
23
  extend Forwardable
24
- def_delegators :@bytes,:empty?,:include?, :length, :each, :^, :|, :&
24
+ def_delegators :@bytes,:empty?,:include?, :length, :each, :|, :&
25
25
 
26
26
  # NOTE
27
27
  # we need to include all the extensions after the regular delegate
@@ -1,5 +1,11 @@
1
1
  module CryptBufferConcern
2
2
  module Xor
3
+
4
+
5
+ def ^(other)
6
+ xor(other)
7
+ end
8
+
3
9
  def xor_at(input,pos)
4
10
  return self if input.nil? || (pos.abs > length)
5
11
 
@@ -35,14 +35,7 @@ class CryptBufferInputConverter
35
35
  end
36
36
 
37
37
  def int2bytes(input)
38
- # integers as strings dont have a 0x prefix
39
- if input.to_s(16).match(/^[0-9a-fA-F]+$/)
40
- # assume 0x prefixed integer
41
- hex2bytes(normalize_hex(input.to_s(16)))
42
- else
43
- # regular number
44
- [input].pack('C*').bytes
45
- end
38
+ [input].pack('C*').bytes
46
39
  end
47
40
 
48
41
  def hex2bytes(hexstr)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crypto-toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Sivia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aes