cryptopp 0.0.5 → 0.0.6

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: 68d183271bac57caacfe1f66a50dad317c4de678
4
- data.tar.gz: a87c4ec4a2469fcbc766435b7072e97106b2b2e3
3
+ metadata.gz: 5e3ca597f024ac6ca96e7e7315ecffa2f93f22f6
4
+ data.tar.gz: 1622315d9b12c1346b11d4fd5f930037c3a1a29f
5
5
  SHA512:
6
- metadata.gz: 9a0845962d2279bc631f4212b7a5b2e5ed098216d9fc1af0eed42d47136500986e01baf70e0d1464e9afa889fd684ddc4f9e19487eb4e491abf2046a00691dc5
7
- data.tar.gz: 236319c0bf9930ae7b7bb859d534fe55d3e42499adc21271f75cd14b064ea79223fbd2864f4ab223af992fa1fb5df9cd0e25eb87c1e1664f8feff3e632cd4a21
6
+ metadata.gz: 74768ad9b62fc0d8235d7a4132bb1c0345f366e5b2629c084d5d5d5034db70c7e8a8c03e361329af0867384970c836badfa3db37c27a55b80957c3177cf11a44
7
+ data.tar.gz: 6544aa80142cd2e62a165bce3377282ace7051d67ced019c125c17c247d0fb4171f0e9b9d537ca9e04beb795cc54d4b7cfe25467d8279d223a71da64246893cc
data/.gitignore CHANGED
@@ -1,6 +1,8 @@
1
1
  ext/*.bundle
2
2
  ext/*.o
3
3
  ext/extconf.h
4
+ mkmf.log
5
+ lib/
4
6
  doc
5
7
  *.kpf
6
8
  *~
@@ -0,0 +1,13 @@
1
+ cache: bundler
2
+ sudo: false
3
+ language: ruby
4
+ rvm:
5
+ - 2.4.2
6
+ - 2.3.5
7
+ - 2.2.8
8
+ before_script:
9
+ - bundle exec rake compile
10
+ addons:
11
+ apt:
12
+ packages:
13
+ - libcrypto++-dev
data/Gemfile CHANGED
@@ -2,11 +2,22 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rdoc", "~> 3.12"
6
- gem "rake", "~> 10.0"
7
- gem "minitest"
8
- gem "minitest-reporters"
9
- gem "guard-minitest"
5
+ gem 'rdoc'
6
+ gem 'rake'
7
+ gem 'minitest'
8
+ gem 'minitest-reporters'
9
+ gem 'rake-compiler'
10
+
11
+ platforms :rbx do
12
+ gem 'rubysl', '~> 2.0'
13
+ gem 'rubinius-developer_tools'
14
+ end
15
+
16
+ if RUBY_VERSION >= '1.9'
17
+ gem 'simplecov'
18
+ gem 'guard'
19
+ gem 'guard-minitest'
20
+ end
10
21
 
11
22
  if File.exists?('Gemfile.local')
12
23
  instance_eval File.read('Gemfile.local')
@@ -1,4 +1,4 @@
1
- Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
1
+ Copyright (c) 2002-2017 J Smith <dark.panda@gmail.com>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/Rakefile CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  require 'rubygems'
6
6
  require 'rubygems/package_task'
7
+ require 'rake/extensiontask'
7
8
  require 'rake/testtask'
8
9
  require 'rdoc/task'
9
10
  require 'bundler/gem_tasks'
@@ -19,6 +20,8 @@ Rake::TestTask.new(:test) do |t|
19
20
  t.warning = !!ENV['WARNINGS']
20
21
  end
21
22
 
23
+ task :default => :test
24
+
22
25
  desc 'Build docs'
23
26
  Rake::RDocTask.new do |t|
24
27
  t.title = "CryptoPP #{version}"
@@ -33,3 +36,8 @@ Rake::RDocTask.new do |t|
33
36
  )
34
37
  end
35
38
 
39
+ desc 'Compile the extension'
40
+ Rake::ExtensionTask.new 'cryptopp' do |ext|
41
+ ext.ext_dir = 'ext/'
42
+ end
43
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -11,9 +11,9 @@
11
11
  #include "config.h"
12
12
  #endif
13
13
 
14
+ #include "jconfig.h"
14
15
  #include "jbase.h"
15
16
  #include "jhash.h"
16
- #include "jconfig.h"
17
17
 
18
18
  #include "cryptopp_ruby_api.h"
19
19
 
@@ -10,7 +10,7 @@ if RbConfig::CONFIG["arch"] =~ /-darwin\d/
10
10
  end
11
11
 
12
12
  CONFIG["CXX"] = "clang++"
13
- elsif RbConfig::CONFIG["arch"] =~ /x86_64-freebsd/
13
+ elsif RbConfig::CONFIG["arch"] =~ /x86_64-(freebsd|linux)/
14
14
  $LDFLAGS << " -fPIC -shared"
15
15
  else
16
16
  $LDFLAGS << " -shared"
@@ -31,6 +31,8 @@ def error msg
31
31
  abort
32
32
  end
33
33
 
34
+ dir_config('cryptopp')
35
+
34
36
  unless find_library('cryptopp', nil, *%w{
35
37
  /usr/local/lib
36
38
  /usr/local/lib/cryptopp
@@ -63,19 +65,5 @@ unless find_header('cryptlib.h', *%w{
63
65
  error "Can't find cryptlib.h"
64
66
  end
65
67
 
66
- have_blocksize = try_link(<<SRC)
67
- #include "cryptlib.h"
68
- #include "sha3.h"
69
-
70
- int main() {
71
- CryptoPP::SHA3_224::BLOCKSIZE;
72
- return 0;
73
- }
74
- SRC
75
-
76
- if have_blocksize
77
- $defs << "-DHAVE_CRYPTOPP_SHA3_BLOCKSIZE"
78
- end
79
-
80
68
  create_makefile('cryptopp')
81
69
 
@@ -8,6 +8,7 @@
8
8
  #ifndef __JCONFIG_H__
9
9
  #define __JCONFIG_H__
10
10
 
11
+ #include "dll.h"
11
12
  #include "cryptlib.h"
12
13
 
13
14
  #define ENABLED_THREEWAY_CIPHER 1
@@ -95,7 +96,6 @@
95
96
  #define ENABLED_SHA3_384_HMAC 1
96
97
  #define ENABLED_SHA3_512_HMAC 1
97
98
  #else
98
- #warning CRYPTOPP_VERSION
99
99
  #define ENABLED_SHA3_224_HMAC 0
100
100
  #define ENABLED_SHA3_256_HMAC 0
101
101
  #define ENABLED_SHA3_384_HMAC 0
@@ -9,6 +9,7 @@
9
9
  #define __JEXCEPTION_H__
10
10
 
11
11
  #include <string>
12
+ #include "dll.h"
12
13
  #include "cryptlib.h"
13
14
 
14
15
  class JException : public CryptoPP::Exception
@@ -30,13 +30,9 @@
30
30
  #include "jhmac_t.h"
31
31
  #endif
32
32
 
33
-
34
33
  // Crypto++ headers...
35
-
36
- #ifdef HAVE_CRYPTOPP_SHA3_BLOCKSIZE
34
+ #if ANY_SHA3_HASH_ENABLED || ANY_SHA3_HMAC_ENABLED
37
35
  #include "sha3.h"
38
- #else
39
- #include "jsha3_blocksizes.h"
40
36
  #endif
41
37
 
42
38
  using namespace CryptoPP;
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class CiphersTest < MiniTest::Unit::TestCase
5
+ class CiphersTest < Minitest::Test
6
6
  extend TestHelper
7
7
 
8
8
  Dir.glob('test/data/ciphers/*.yml').sort.each do |f|
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class DigestsTest < MiniTest::Unit::TestCase
5
+ class DigestsTest < Minitest::Test
6
6
  extend TestHelper
7
7
 
8
8
  Dir.glob('test/data/digests/*.yml').sort.each do |f|
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class HMACsTest < MiniTest::Unit::TestCase
5
+ class HMACsTest < Minitest::Test
6
6
  extend TestHelper
7
7
 
8
8
  Dir.glob('test/data/hmacs/*.yml').sort.each do |f|
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'minitest/autorun'
4
4
  require 'minitest/reporters' if RUBY_VERSION >= '1.9'
5
5
  require 'yaml'
6
- require File.join(File.dirname(__FILE__), %w{ .. ext cryptopp })
6
+ require 'cryptopp'
7
7
 
8
8
  puts "Version #{CryptoPP::VERSION}"
9
9
  puts "Crypto++ version #{CryptoPP::CRYPTOPP_VERSION}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - J Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-23 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: cryptopp is a cryptographic library for Ruby built on Wei Dai's Crypto++.
14
14
  email: dark.panda@gmail.com
@@ -19,6 +19,7 @@ extra_rdoc_files:
19
19
  - README
20
20
  files:
21
21
  - ".gitignore"
22
+ - ".travis.yml"
22
23
  - Gemfile
23
24
  - Guardfile
24
25
  - MIT-LICENSE
@@ -115,7 +116,6 @@ files:
115
116
  - ext/jserpent.h
116
117
  - ext/jsha.h
117
118
  - ext/jsha3.h
118
- - ext/jsha3_blocksizes.h
119
119
  - ext/jshacal2.cpp
120
120
  - ext/jshacal2.h
121
121
  - ext/jshark.cpp
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.2.2
204
+ rubygems_version: 2.6.13
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: cryptopp is a cryptographic library for Ruby built on Wei Dai's Crypto++.
@@ -1,73 +0,0 @@
1
- // sha3.h - written and placed in the public domain by Wei Dai
2
- //
3
- // This is a patched version of sha3.h that includes definitions for the
4
- // BLOCKSIZE constants that appear to be missing from the header file.
5
- // See http://sourceforge.net/apps/trac/cryptopp/ticket/31 for details.
6
-
7
- #ifndef CRYPTOPP_JSHA3_BLOCKSIZES_H
8
- #define CRYPTOPP_JSHA3_BLOCKSIZES_H
9
-
10
- #include "cryptlib.h"
11
- #include "secblock.h"
12
-
13
- NAMESPACE_BEGIN(CryptoPP)
14
-
15
- /// <a href="http://en.wikipedia.org/wiki/SHA-3">SHA-3</a>
16
- class SHA3 : public HashTransformation
17
- {
18
- public:
19
- SHA3(unsigned int digestSize) : m_digestSize(digestSize) {Restart();}
20
- unsigned int DigestSize() const {return m_digestSize;}
21
- std::string AlgorithmName() const {return "SHA-3-" + IntToString(m_digestSize*8);}
22
- unsigned int OptimalDataAlignment() const {return GetAlignmentOf<word64>();}
23
-
24
- void Update(const byte *input, size_t length);
25
- void Restart();
26
- void TruncatedFinal(byte *hash, size_t size);
27
-
28
- protected:
29
- inline unsigned int r() const {return 200 - 2 * m_digestSize;}
30
-
31
- FixedSizeSecBlock<word64, 25> m_state;
32
- unsigned int m_digestSize, m_counter;
33
- };
34
-
35
- class SHA3_224 : public SHA3
36
- {
37
- public:
38
- CRYPTOPP_CONSTANT(DIGESTSIZE = 28)
39
- CRYPTOPP_CONSTANT(BLOCKSIZE = 144)
40
- SHA3_224() : SHA3(DIGESTSIZE) {}
41
- static const char * StaticAlgorithmName() {return "SHA-3-224";}
42
- };
43
-
44
- class SHA3_256 : public SHA3
45
- {
46
- public:
47
- CRYPTOPP_CONSTANT(DIGESTSIZE = 32)
48
- CRYPTOPP_CONSTANT(BLOCKSIZE = 136)
49
- SHA3_256() : SHA3(DIGESTSIZE) {}
50
- static const char * StaticAlgorithmName() {return "SHA-3-256";}
51
- };
52
-
53
- class SHA3_384 : public SHA3
54
- {
55
- public:
56
- CRYPTOPP_CONSTANT(DIGESTSIZE = 48)
57
- CRYPTOPP_CONSTANT(BLOCKSIZE = 104)
58
- SHA3_384() : SHA3(DIGESTSIZE) {}
59
- static const char * StaticAlgorithmName() {return "SHA-3-384";}
60
- };
61
-
62
- class SHA3_512 : public SHA3
63
- {
64
- public:
65
- CRYPTOPP_CONSTANT(DIGESTSIZE = 64)
66
- CRYPTOPP_CONSTANT(BLOCKSIZE = 72)
67
- SHA3_512() : SHA3(DIGESTSIZE) {}
68
- static const char * StaticAlgorithmName() {return "SHA-3-512";}
69
- };
70
-
71
- NAMESPACE_END
72
-
73
- #endif