@oslojs/crypto
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -104,3 +104,2 @@ import { bigIntBytes } from "@oslojs/binary"; | ||
multiply(k, point) { | ||
// For co-factor h > 1, ensure the point is in the prime order subgroup | ||
const kBytes = bigIntBytes(k); | ||
@@ -107,0 +106,0 @@ // montgomery ladder |
@@ -11,4 +11,4 @@ import type { ECDSANamedCurve } from "./curve.js"; | ||
encodeSEC1Compressed(): Uint8Array; | ||
encodeX509Uncompressed(): Uint8Array; | ||
encodeX509Compressed(): Uint8Array; | ||
encodePKIXUncompressed(): Uint8Array; | ||
encodePKIXCompressed(): Uint8Array; | ||
} | ||
@@ -21,6 +21,6 @@ export declare function decodeSEC1PublicKey(curve: ECDSANamedCurve, bytes: Uint8Array): ECDSAPublicKey; | ||
encodeIEEEP1363(curve: ECDSANamedCurve): Uint8Array; | ||
encodeX509(): Uint8Array; | ||
encodePKIX(): Uint8Array; | ||
} | ||
export declare function decodeIEEEP1363ECDSASignature(curve: ECDSANamedCurve, bytes: Uint8Array): ECDSASignature; | ||
export declare function decodeX509ECDSASignature(der: Uint8Array): ECDSASignature; | ||
export declare function decodeX509ECDSAPublicKey(bytes: Uint8Array, curves: ECDSANamedCurve[]): ECDSAPublicKey; | ||
export declare function decodePKIXECDSASignature(der: Uint8Array): ECDSASignature; | ||
export declare function decodePKIXECDSAPublicKey(bytes: Uint8Array, curves: ECDSANamedCurve[]): ECDSAPublicKey; |
@@ -63,3 +63,3 @@ import { ECDSAPoint } from "./curve.js"; | ||
} | ||
encodeX509Uncompressed() { | ||
encodePKIXUncompressed() { | ||
const algorithmIdentifier = new ASN1EncodableSequence([ | ||
@@ -74,3 +74,3 @@ new ASN1ObjectIdentifier(encodeObjectIdentifier("1.2.840.10045.2.1")), | ||
} | ||
encodeX509Compressed() { | ||
encodePKIXCompressed() { | ||
const algorithmIdentifier = new ASN1EncodableSequence([ | ||
@@ -148,3 +148,3 @@ new ASN1ObjectIdentifier(encodeObjectIdentifier("1.2.840.10045.2.1")), | ||
} | ||
encodeX509() { | ||
encodePKIX() { | ||
const asn1 = new ASN1EncodableSequence([new ASN1Integer(this.r), new ASN1Integer(this.s)]); | ||
@@ -162,3 +162,3 @@ return encodeASN1(asn1); | ||
} | ||
export function decodeX509ECDSASignature(der) { | ||
export function decodePKIXECDSASignature(der) { | ||
try { | ||
@@ -172,3 +172,3 @@ const sequence = parseASN1NoLeftoverBytes(der).sequence(); | ||
} | ||
export function decodeX509ECDSAPublicKey(bytes, curves) { | ||
export function decodePKIXECDSAPublicKey(bytes, curves) { | ||
let algorithmIdentifierObjectIdentifier; | ||
@@ -175,0 +175,0 @@ let algorithmIdentifierParameter; |
@@ -1,4 +0,4 @@ | ||
export { decodeIEEEP1363ECDSASignature, decodeSEC1PublicKey, decodeX509ECDSAPublicKey, decodeX509ECDSASignature, ECDSAPublicKey, ECDSASignature, verifyECDSASignature } from "./ecdsa.js"; | ||
export { decodeIEEEP1363ECDSASignature, decodeSEC1PublicKey, decodePKIXECDSAPublicKey, decodePKIXECDSASignature, ECDSAPublicKey, ECDSASignature, verifyECDSASignature } from "./ecdsa.js"; | ||
export { p192, p224, p256, p384, p521 } from "./curve-nist.js"; | ||
export { secp192k1, secp192r1, secp224k1, secp224r1, secp256k1, secp256r1, secp384r1, secp521r1 } from "./curve-sec.js"; | ||
export { ECDSANamedCurve } from "./curve.js"; |
@@ -1,4 +0,4 @@ | ||
export { decodeIEEEP1363ECDSASignature, decodeSEC1PublicKey, decodeX509ECDSAPublicKey, decodeX509ECDSASignature, ECDSAPublicKey, ECDSASignature, verifyECDSASignature } from "./ecdsa.js"; | ||
export { decodeIEEEP1363ECDSASignature, decodeSEC1PublicKey, decodePKIXECDSAPublicKey, decodePKIXECDSASignature, ECDSAPublicKey, ECDSASignature, verifyECDSASignature } from "./ecdsa.js"; | ||
export { p192, p224, p256, p384, p521 } from "./curve-nist.js"; | ||
export { secp192k1, secp192r1, secp224k1, secp224r1, secp256k1, secp256r1, secp384r1, secp521r1 } from "./curve-sec.js"; | ||
export { ECDSANamedCurve } from "./curve.js"; |
{ | ||
"name": "@oslojs/crypto", | ||
"type": "module", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "A very basic crypto library", | ||
@@ -14,2 +14,3 @@ "files": [ | ||
"./random": "./dist/random/index.js", | ||
"./rsa": "./dist/rsa/index.js", | ||
"./sha1": "./dist/sha1/index.js", | ||
@@ -33,2 +34,5 @@ "./sha2": "./dist/sha2/index.js", | ||
], | ||
"rsa": [ | ||
"dist/rsa/index.d.ts" | ||
], | ||
"sha1": [ | ||
@@ -54,3 +58,4 @@ "dist/sha1/index.d.ts" | ||
"hmac", | ||
"ecdsa" | ||
"ecdsa", | ||
"rsa" | ||
], | ||
@@ -64,2 +69,3 @@ "repository": { | ||
"devDependencies": { | ||
"@oslojs/encoding": "0.3.0", | ||
"@scure/base": "^1.1.3", | ||
@@ -66,0 +72,0 @@ "@types/node": "^20.8.6", |
@@ -5,3 +5,3 @@ # @oslojs/crypto documentation | ||
A basic JavaScript crypto library by [Oslo](https://oslojs.dev). Includes APIs for SHA-1, SHA-2, HMAC, ECDSA, and cryptographically secure random generator. | ||
A basic JavaScript crypto library by [Oslo](https://oslojs.dev). Includes APIs for SHA-1, SHA-2, HMAC, ECDSA, RSA, and cryptographically secure random generator. | ||
@@ -8,0 +8,0 @@ - Runtime-agnostic |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67375
37
1671
10