Skip to content
Snippets Groups Projects
Commit 9f5ccf9d authored by Millicent Billette's avatar Millicent Billette
Browse files

v3.3.0

DOC: french CHANGELOG.fr.md updated
parent 0ddfc0a1
No related branches found
No related tags found
No related merge requests found
Pipeline #17340 failed
......@@ -10,9 +10,21 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0
- GraphQL stuff
- @@@@ comme séparateur entre identifiant secret et mdp pour la génération de combinaison à tester (usage principal Gsper)
- supprimer automatiquement le code inutile dans les lib (Tree Shaking)
- chiffrer déchiffrer des messages
- lire et écrire des messages au format cesium+
## [Non-publié/Non-Stabilisé] (par [1000i100])
## [Version 3.3.0] - 2022-09-30 (par [1000i100])
### Ajouté
- crypto.isPubKey(pubKey) identique à checkKey mais retourne vrai ou faux là où checkKey throw une erreur en cas d'échec de validation.
- crypto.checkKey(pubKey) accepte désormais aussi les clefs sans checksum grace aux vérifications précises désormais effectuable sur la clef.
- crypto.checkKey(pubKey) accepte également les clefs au format binaire.
- crypto.isDuniterPubKey(b58pubKey) vérifie la conformité au Protocol Blockchain Duniter [V11](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key) et [V12](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0010_Duniter_Blockchain_Protocol_V12.md#public-key)
- crypto.isEd25519PubKey(b58pubKey) vérifie que la clef désigne bien un point sur la courbe ed25519 tel que défini dans la [RFC8032 5.1.3](https://www.rfc-editor.org/rfc/rfc8032#page-11)
### Corrections
- La CI ajuste désormais les chemins d'inclusion pour construire les builds static, que ces chemins sont décrits entre simple ou double guillemet.
## [Version 3.2.0] - 2022-01-31 (par [1000i100])
### Ajouté
- crypto.checkKey(pubKeyWithChecksum)
......@@ -74,8 +86,9 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0
- intégration des librairies de crypto nécessaires
- calcul de la clef publique correspondant à chaque combinaison de secrets saisie, et comparaison à la clef publique de référence.
[Non-publié/Non-Stabilisé]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.2.0...master
[Non-publié/Non-Stabilisé]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.3.0...master
[Version 3.3.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.2.0...v3.3.0
[Version 3.2.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.1.0...v3.2.0
[Version 3.1.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.0.3...v3.1.0
[Version 3.0.2]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.0.1...v3.0.2
......
{
"name": "g1lib",
"version": "3.2.0",
"version": "3.3.0",
"description": "An ubiquitous static javascript toolbox lib for Ǧ1 / Duniter ecosystem with reliability in mind.",
"main": "nodejs/all.mjs",
"browser": "browser/all.mjs",
......
......@@ -33,11 +33,11 @@
"watch2null": "chokidar src/* -c \"npm run test:dev:runTests 2>/dev/null\""
},
"dependencies": {
"@noble/ed25519": "^1.7.1",
"cross-fetch": "^3.1.5",
"ed2curve": "https://github.com/1000i100/ed2curve#master",
"js-sha256": "github:1000i100/js-sha256#master",
"latinize-to-ascii": "^0.5.2",
"@noble/ed25519": "^1.7.1",
"node-fetch": "^3.2.10",
"scrypt-async-modern": "^3.0.12",
"tweetnacl": "^1.0.3"
......
......@@ -133,17 +133,17 @@ export function isEd25519PubKey(b58pubKey){
return true;
}
export function checkKey(pubKeyWithOrWithoutChecksum, checkRawPubKey= true) {
const binPubKey = pubKey2bin(pubKeyWithOrWithoutChecksum)
export function checkKey(pubKey, checkRawPubKey= true) {
const binPubKey = pubKey2bin(pubKey)
const b58pubKey = b58.encode(binPubKey);
if(!checkRawPubKey) return true;
if(!isDuniterPubKey(b58pubKey)) throw new Error("Invalid public key : this string don't follow rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key");
if(!isEd25519PubKey(b58pubKey)) throw new Error("Invalid public key : not a valid ed25519 point RFC8032 5.1.3 https://www.rfc-editor.org/rfc/rfc8032#page-11");
return true;
}
export function isPubKey(b58pubKey){
export function isPubKey(pubKey){
try{
return checkKey(b58pubKey)
return checkKey(pubKey)
} catch (e){return false;}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment