Skip to content

Commit 98be0a7

Browse files
committed
preparing for release, added sonarcloud gh
1 parent 2ad5c15 commit 98be0a7

File tree

10 files changed

+109
-46
lines changed

10 files changed

+109
-46
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: SonarScanner
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: SonarScanner
11+
runs-on: ubuntu-20.04
12+
env:
13+
SONAR_SCANNER_VERSION: 4.6.2.2472
14+
SONAR_SERVER_URL: "https://sonarcloud.io"
15+
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
submodules: recursive
20+
- name: install packages
21+
run: |
22+
sudo apt update
23+
sudo apt install ninja-build autoconf automake
24+
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v1
27+
with:
28+
java-version: 11
29+
- name: Cache SonarCloud packages
30+
uses: actions/cache@v1
31+
with:
32+
path: ~/.sonar/cache
33+
key: ${{ runner.os }}-sonar
34+
restore-keys: ${{ runner.os }}-sonar
35+
- name: Download and set up sonar-scanner
36+
env:
37+
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
38+
run: |
39+
mkdir -p $HOME/.sonar
40+
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
41+
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
42+
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
43+
- name: Download and set up build-wrapper
44+
env:
45+
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
46+
run: |
47+
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
48+
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
49+
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
50+
51+
- name: Run build-wrapper
52+
run: |
53+
mkdir build
54+
cmake -DCMAKE_BUILD_TYPE=Release -B build -G "Ninja" .
55+
cmake --build build --config Release --parallel 2 --target libsodium-external
56+
cmake --build build --config Release --parallel 2 --target blst-external
57+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
58+
59+
- name: Run sonar-scanner
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
63+
run: |
64+
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else()
1616
set(BUILD_SHARED_LIBS ON)
1717
endif()
1818

19-
project(ecc VERSION 1.0.6)
19+
project(ecc VERSION 1.0.7)
2020
project(ecc LANGUAGES C)
2121

2222
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
[![c](https://github.com/aldenml/ecc/actions/workflows/c.yml/badge.svg?branch=master)](https://github.com/aldenml/ecc/actions/workflows/c.yml)
44
[![js](https://github.com/aldenml/ecc/actions/workflows/js.yml/badge.svg?branch=master)](https://github.com/aldenml/ecc/actions/workflows/js.yml)
5+
[![macOS](https://github.com/aldenml/ecc/actions/workflows/macos.yml/badge.svg?branch=master)](https://github.com/aldenml/ecc/actions/workflows/macos.yml)
56
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/5fac0b504c25497ca621938007bc1cf6)](https://app.codacy.com/gh/aldenml/ecc/dashboard)
67
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/5fac0b504c25497ca621938007bc1cf6)](https://www.codacy.com/gh/aldenml/ecc/dashboard)
8+
[![javadoc](https://javadoc.io/badge2/org.ssohub/ecc/javadoc.svg)](https://javadoc.io/doc/org.ssohub/ecc)
79

810
Library to work with elliptic-curve cryptography based on [libsodium](https://github.com/jedisct1/libsodium)
911
and [blst](https://github.com/supranational/blst).
1012

11-
| Bindings | | |
12-
|--------------------|---|---|
13-
| Java | [jvm](jvm) | [![maven](https://img.shields.io/maven-central/v/org.ssohub/ecc.svg?label=maven)](https://search.maven.org/search?q=g:%22org.ssohub%22%20AND%20a:%22ecc%22) |
14-
| Javascript | [js/ecc](js/ecc) | [![npm](https://img.shields.io/npm/v/@aldenml/ecc)](https://www.npmjs.com/package/@aldenml/ecc) |
13+
| Bindings | | |
14+
|--------------------|-------------------------|---|
15+
| Java | [jvm/ecc](bindings/jvm) | [![maven](https://img.shields.io/maven-central/v/org.ssohub/ecc.svg?label=maven)](https://search.maven.org/search?q=g:%22org.ssohub%22%20AND%20a:%22ecc%22) |
16+
| Javascript | [js/ecc](bindings/js) | [![npm](https://img.shields.io/npm/v/@aldenml/ecc)](https://www.npmjs.com/package/@aldenml/ecc) |
1517

1618
### OPRF Oblivious pseudo-random functions using ristretto255
1719

bindings/js/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 Alden Torres
1+
Copyright (c) 2021-2022 Alden Torres
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

bindings/js/dist/ecc.dev.js

Lines changed: 18 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/js/dist/ecc.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/js/dist/opaque.d.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This is implemented by generating a random "seed", then
55
* calling internally DeriveAuthKeyPair.
66
*
7-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-2
7+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-2
88
*
99
* @return object {private_key, public_key}
1010
*/
@@ -13,7 +13,7 @@ export function opaque_ristretto255_sha512_GenerateAuthKeyPair(): Promise<{
1313
public_key: Uint8Array;
1414
}>;
1515
/**
16-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-5.1.1.1
16+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-5.1.1.1
1717
*
1818
* @param {Uint8Array} password an opaque byte string containing the client's password
1919
* @return object {request, blind}
@@ -26,7 +26,7 @@ export function opaque_ristretto255_sha512_CreateRegistrationRequest(password: U
2626
* In order to make this method not to use dynamic memory allocation, there is a
2727
* limit of credential_identifier to length <= 200.
2828
*
29-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-5.1.1.2
29+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-5.1.1.2
3030
*
3131
* @param {Uint8Array} request_raw a RegistrationRequest structure
3232
* @param {Uint8Array} server_public_key the server's public key
@@ -43,31 +43,29 @@ export function opaque_ristretto255_sha512_CreateRegistrationResponse(request_ra
4343
* executes the following function. Since this works in the internal key mode, the
4444
* "client_private_key" is null.
4545
*
46-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-5.1.1.3
46+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-5.1.1.3
4747
*
48-
* @param {Uint8Array} client_private_key the client's private key (always null, internal mode)
4948
* @param {Uint8Array} password an opaque byte string containing the client's password
5049
* @param {Uint8Array} blind the OPRF scalar value used for blinding
5150
* @param {Uint8Array} response_raw a RegistrationResponse structure
5251
* @param {Uint8Array} server_identity the optional encoded server identity
5352
* @param {Uint8Array} client_identity the optional encoded client identity
5453
* @return object {record, export_key}
5554
*/
56-
export function opaque_ristretto255_sha512_FinalizeRequest(client_private_key: Uint8Array, password: Uint8Array, blind: Uint8Array, response_raw: Uint8Array, server_identity: Uint8Array, client_identity: Uint8Array): Promise<{
55+
export function opaque_ristretto255_sha512_FinalizeRequest(password: Uint8Array, blind: Uint8Array, response_raw: Uint8Array, server_identity: Uint8Array, client_identity: Uint8Array): Promise<{
5756
record: Uint8Array;
5857
export_key: Uint8Array;
5958
}>;
6059
/**
61-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-6.2.3
60+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-6.2.3
6261
*
6362
* @param {Uint8Array} state_raw a ClientState structure
64-
* @param {Uint8Array} client_identity the optional encoded client identity, which is null if not specified
6563
* @param {Uint8Array} password an opaque byte string containing the client's password
6664
* @return {Promise<Uint8Array>} a KE1 message structure
6765
*/
68-
export function opaque_ristretto255_sha512_3DH_ClientInit(state_raw: Uint8Array, client_identity: Uint8Array, password: Uint8Array): Promise<Uint8Array>;
66+
export function opaque_ristretto255_sha512_3DH_ClientInit(state_raw: Uint8Array, password: Uint8Array): Promise<Uint8Array>;
6967
/**
70-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-6.2.3
68+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-6.2.3
7169
*
7270
* @param {Uint8Array} state_raw a ClientState structure
7371
* @param {Uint8Array} password an opaque byte string containing the client's password
@@ -85,13 +83,14 @@ export function opaque_ristretto255_sha512_3DH_ClientFinish(state_raw: Uint8Arra
8583
finish_ret: any;
8684
}>;
8785
/**
88-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-6.2.4
86+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-6.2.4
8987
*
9088
* @param {Uint8Array} state_raw a ServerState structure
9189
* @param {Uint8Array} server_identity the optional encoded server identity, which is set to
9290
* server_public_key if null
9391
* @param {Uint8Array} server_private_key the server's private key
9492
* @param {Uint8Array} server_public_key the server's public key
93+
* @param {Uint8Array} client_identity
9594
* @param {Uint8Array} record_raw the client's RegistrationUpload structure
9695
* @param {Uint8Array} credential_identifier an identifier that uniquely represents the credential
9796
* being registered
@@ -100,9 +99,9 @@ export function opaque_ristretto255_sha512_3DH_ClientFinish(state_raw: Uint8Arra
10099
* @param {Uint8Array} context the application specific context
101100
* @return {Promise<Uint8Array>} a KE2 structure
102101
*/
103-
export function opaque_ristretto255_sha512_3DH_ServerInit(state_raw: Uint8Array, server_identity: Uint8Array, server_private_key: Uint8Array, server_public_key: Uint8Array, record_raw: Uint8Array, credential_identifier: Uint8Array, oprf_seed: Uint8Array, ke1_raw: Uint8Array, context: Uint8Array): Promise<Uint8Array>;
102+
export function opaque_ristretto255_sha512_3DH_ServerInit(state_raw: Uint8Array, server_identity: Uint8Array, server_private_key: Uint8Array, server_public_key: Uint8Array, client_identity: Uint8Array, record_raw: Uint8Array, credential_identifier: Uint8Array, oprf_seed: Uint8Array, ke1_raw: Uint8Array, context: Uint8Array): Promise<Uint8Array>;
104103
/**
105-
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-05#section-6.2.4
104+
* See https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque-07#section-6.2.4
106105
*
107106
* @param {Uint8Array} state_raw a ServerState structure
108107
* @param {Uint8Array} ke3_raw a KE3 structure

bindings/js/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aldenml/ecc",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "elliptic curves crypto functions",
55
"main": "index.js",
66
"types": "./dist/index.d.ts",
@@ -66,7 +66,7 @@
6666
"bugs": {
6767
"url": "https://github.com/aldenml/ecc/issues"
6868
},
69-
"homepage": "https://github.com/aldenml/ecc/tree/master/js/ecc#ecc",
69+
"homepage": "https://github.com/aldenml/ecc/tree/master/bindings/js#ecc",
7070
"type": "module",
7171
"devDependencies": {
7272
"mocha": "9.1.3",

bindings/jvm/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Alden Torres
2+
* Copyright (c) 2021-2022, Alden Torres
33
*
44
* Licensed under the terms of the MIT license.
55
* Copy of the license at https://opensource.org/licenses/MIT
@@ -12,7 +12,7 @@ plugins {
1212
}
1313

1414
group = "org.ssohub"
15-
version = "1.0.6"
15+
version = "1.0.7"
1616

1717
java {
1818
sourceCompatibility = JavaVersion.VERSION_1_8

0 commit comments

Comments
 (0)