x25519 1.0.9 → 1.0.10

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
  SHA256:
3
- metadata.gz: 11ff922b9b148a4f8b37ae6ad4a6e1638930b50b93e5d45a169e0b1399963d22
4
- data.tar.gz: 2b947a4726bc75e6a492821d25a656cce2852fa9d4b5a72cec491766f0cde724
3
+ metadata.gz: 7b02674dff65b61427949152e152de05626d7f165fed9dc8e8ef49a8a409de77
4
+ data.tar.gz: 6ea193c186474a16d7a495a2ab6988fd282789076cc97ffcb6e43337553b218e
5
5
  SHA512:
6
- metadata.gz: 00caf2f9602bcf4af710eb0eadce522cf0bcf6fa9c00e06c75af67b2c94c24d96d19bd9a0213b6ec30146e13e2d989bc8e145c5690be1773fceb52fa974b914e
7
- data.tar.gz: dc318a0d65303ffc6ac7e5dd27aefc93bd500e3f56354d13d7264072e331f58aeb36f50cf176cbfcfb1dc082223908544a36b0afd05a8cad68455ca099cda6c5
6
+ metadata.gz: 4ecc2260f15c22112bf6f57f2d9e6a2c2fa7dd81ae6827ebb90e9f6ea41e103b3d3778ef03e03eda27aa1b60be3baeb7d7e548b0633735d0fe732c6098f7447c
7
+ data.tar.gz: ee3f4f15b3ee69475bfeb776dabd50b9f7290aa9d25352f2521485ebeaab206ae00daa4264307dfce90b194c34d1342e4bc2e167dccd6273b85df0a3adf72f36
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.10] (2021-10-06)
2
+
3
+ [1.0.10]: https://github.com/RubyCrypto/x25519/compare/v1.0.9...v1.0.10
4
+
5
+ - [#29](https://github.com/RubyCrypto/x25519/pull/29)
6
+ Allow usage on Apple silicon
7
+
1
8
  ## [1.0.9] (2021-08-04)
2
9
 
3
10
  [1.0.9]: https://github.com/RubyCrypto/x25519/compare/v1.0.8...v1.0.9
data/Rakefile CHANGED
@@ -7,6 +7,8 @@ CLEAN.include("**/*.o", "**/*.so", "**/*.bundle", "pkg", "tmp")
7
7
 
8
8
  require "rake/extensiontask"
9
9
  %w[precomputed ref10].each do |provider|
10
+ next if provider == "precomputed" && RUBY_PLATFORM =~ /arm64-darwin/
11
+
10
12
  Rake::ExtensionTask.new("x25519_#{provider}") do |ext|
11
13
  ext.ext_dir = "ext/x25519_#{provider}"
12
14
  end
@@ -4,8 +4,12 @@
4
4
 
5
5
  require "mkmf"
6
6
 
7
- $CFLAGS << " -Wall -O3 -pedantic -std=c99 -mbmi -mbmi2 -march=haswell"
7
+ if RUBY_PLATFORM =~ /arm64-darwin|aarch64-linux/
8
+ File.write("Makefile", "install clean: ;")
9
+ else
10
+ $CFLAGS << " -Wall -O3 -pedantic -std=c99 -mbmi -mbmi2 -march=haswell"
8
11
 
9
- create_makefile "x25519_precomputed"
12
+ create_makefile "x25519_precomputed"
13
+ end
10
14
 
11
15
  # rubocop:enable Style/GlobalVars
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module X25519
4
+ module Provider
5
+ # We need this class and method even if we can't compile x25519_precomputed
6
+ class Precomputed
7
+ def self.available?
8
+ false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module X25519
4
- VERSION = "1.0.9"
4
+ VERSION = "1.0.10"
5
5
  end
data/lib/x25519.rb CHANGED
@@ -10,7 +10,11 @@ require "x25519/test_vectors"
10
10
 
11
11
  # Native extension backends
12
12
  require "x25519_ref10"
13
- require "x25519_precomputed"
13
+ begin
14
+ require "x25519_precomputed"
15
+ rescue LoadError
16
+ require "x25519/precomputed_not_available"
17
+ end
14
18
 
15
19
  # The X25519 elliptic curve Diffie-Hellman algorithm
16
20
  module X25519
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x25519
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-04 00:00:00.000000000 Z
11
+ date: 2022-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -65,6 +65,7 @@ files:
65
65
  - ext/x25519_ref10/x25519_ref10.h
66
66
  - lib/x25519.rb
67
67
  - lib/x25519/montgomery_u.rb
68
+ - lib/x25519/precomputed_not_available.rb
68
69
  - lib/x25519/scalar.rb
69
70
  - lib/x25519/test_vectors.rb
70
71
  - lib/x25519/version.rb