Skip to content

Commit

Permalink
fixed cocoapods build
Browse files Browse the repository at this point in the history
  • Loading branch information
ypopovych committed May 11, 2021
1 parent 09a0923 commit 1606a71
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ let package = Package(
.define("ED25519_CUSTOMRANDOM"),
.define("ED25519_CUSTOMHASH"),
.define("ED25519_NO_INLINE_ASM"),
.headerSearchPath("src")
.headerSearchPath("src"),
.headerSearchPath("src/ed25519-donna")
]
),
.target(
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSr25519/src/ristretto255.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __ristretto255_H__
#define __ristretto255_H__

#include "ed25519-donna/ed25519-donna.h"
#include "ed25519-donna.h"

typedef uint8_t ristretto255_hash_output[64];

Expand Down
2 changes: 1 addition & 1 deletion Sources/CSr25519/src/sha2.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef struct _SHA512_CTX {
#define REVERSE32(w,x) { \
uint32_t tmp = (w); \
tmp = (tmp >> 16) | (tmp << 16); \
(x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
(x) = ((tmp & (uint32_t)0xff00ff00UL) >> 8) | ((tmp & (uint32_t)0x00ff00ffUL) << 8); \
}

#define REVERSE64(w,x) { \
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSr25519/src/sr25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
void divide_scalar_bytes_by_cofactor(uint8_t *scalar, size_t scalar_len) {
uint8_t low = 0;

for (int i = scalar_len - 1; i >= 0; i--) {
for (ptrdiff_t i = scalar_len - 1; i >= 0; i--) {
uint8_t r = scalar[i] & 7;
scalar[i] >>= 3;
scalar[i] += low;
Expand Down
6 changes: 4 additions & 2 deletions Sr25519.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ Swift wrapper for sr25519-donna C library. Provides Sr25519 and Ed25519 wrappers

s.subspec 'CSr25519' do |ss|
ss.source_files = 'Sources/CSr25519/src/**/*.{h,c}'
ss.public_header_files = 'Sources/CSr25519/include/*.h'
ss.public_header_files = 'Sources/CSr25519/src/sr25519.h', 'Sources/CSr25519/src/sr25519-random*.h', 'Sources/CSr25519/src/ed25519-donna/ed25519.h'

ss.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) ED25519_CUSTOMRANDOM ED25519_CUSTOMHASH ED25519_NO_INLINE_ASM'
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) ED25519_CUSTOMRANDOM ED25519_CUSTOMHASH ED25519_NO_INLINE_ASM',
'GCC_WARN_UNUSED_FUNCTION' => 'NO',
'GCC_WARN_UNUSED_VARIABLE' => 'NO'
}
end

Expand Down
2 changes: 0 additions & 2 deletions Tests/Sr25519Tests/SrVrfTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import XCTest
@testable import Sr25519
import CSr25519
import Sr25519Helpers

final class Sr25519VrfTests: XCTestCase {
let kpData = "88dca235b034ac1a0e6aa9bfe3e919f74eb7d726345bec42979e6f1a20905e58ac5ea3a293dfd93859ee64a5b825937753864c19be857f045758dcae10259ba1049b21bb9cb88471b9dadb50b925135cfb291a463043635b58599a2d01b1fd18".hexData!
Expand Down

0 comments on commit 1606a71

Please sign in to comment.