cryptopp 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +13 -0
- data/Gemfile +16 -5
- data/MIT-LICENSE +1 -1
- data/Rakefile +8 -0
- data/VERSION +1 -1
- data/ext/cryptopp.cpp +1 -1
- data/ext/extconf.rb +3 -15
- data/ext/jconfig.h +1 -1
- data/ext/jexception.h +1 -0
- data/ext/jsha3.h +1 -5
- data/test/ciphers_test.rb +1 -1
- data/test/digests_test.rb +1 -1
- data/test/hmacs_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +4 -4
- data/ext/jsha3_blocksizes.h +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e3ca597f024ac6ca96e7e7315ecffa2f93f22f6
|
4
|
+
data.tar.gz: 1622315d9b12c1346b11d4fd5f930037c3a1a29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74768ad9b62fc0d8235d7a4132bb1c0345f366e5b2629c084d5d5d5034db70c7e8a8c03e361329af0867384970c836badfa3db37c27a55b80957c3177cf11a44
|
7
|
+
data.tar.gz: 6544aa80142cd2e62a165bce3377282ace7051d67ced019c125c17c247d0fb4171f0e9b9d537ca9e04beb795cc54d4b7cfe25467d8279d223a71da64246893cc
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -2,11 +2,22 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem
|
6
|
-
gem
|
7
|
-
gem
|
8
|
-
gem
|
9
|
-
gem
|
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')
|
data/MIT-LICENSE
CHANGED
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.
|
1
|
+
0.0.6
|
data/ext/cryptopp.cpp
CHANGED
data/ext/extconf.rb
CHANGED
@@ -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
|
|
data/ext/jconfig.h
CHANGED
@@ -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
|
data/ext/jexception.h
CHANGED
data/ext/jsha3.h
CHANGED
@@ -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;
|
data/test/ciphers_test.rb
CHANGED
data/test/digests_test.rb
CHANGED
data/test/hmacs_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -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
|
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.
|
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:
|
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.
|
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++.
|
data/ext/jsha3_blocksizes.h
DELETED
@@ -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
|