Skip to content

Commit

Permalink
Merge pull request #117 from roots-id/r1_in_indexer
Browse files Browse the repository at this point in the history
Add indexes for secp256r1 signatures
  • Loading branch information
rodolfomiranda authored Oct 6, 2023
2 parents 1c1d34c + bab8bfb commit dda0752
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/keri/core/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ export class IndexerCodex {
Ed25519_Crt_Sig: string = 'B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Sig: string = 'C' // ECDSA secp256k1 sig appears same in both lists if any.
ECDSA_256k1_Crt_Sig: string = 'D' // ECDSA secp256k1 sig appears in current list.
ECDSA_256r1_Sig: string = "E" // ECDSA secp256r1 sig appears same in both lists if any.
ECDSA_256r1_Crt_Sig: string = "F" // ECDSA secp256r1 sig appears in current list.
Ed448_Sig: string = '0A' // Ed448 signature appears in both lists.
Ed448_Crt_Sig: string = '0B' // Ed448 signature appears in current list only.
Ed25519_Big_Sig: string = '2A' // Ed25519 sig appears in both lists.
Ed25519_Big_Crt_Sig: string = '2B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Big_Sig: string = '2C' // ECDSA secp256k1 sig appears in both lists.
ECDSA_256k1_Big_Crt_Sig: string = '2D' // ECDSA secp256k1 sig appears in current list only.
ECDSA_256r1_Big_Sig: string = "2E" // ECDSA secp256r1 sig appears in both lists.
ECDSA_256r1_Big_Crt_Sig: string = "2F" // ECDSA secp256r1 sig appears in current list only.
Ed448_Big_Sig: string = '3A' // Ed448 signature appears in both lists.
Ed448_Big_Crt_Sig: string = '3B' // Ed448 signature appears in current list only.

Expand All @@ -26,12 +30,16 @@ export class IndexedSigCodex {
Ed25519_Crt_Sig: string = 'B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Sig: string = 'C' // ECDSA secp256k1 sig appears same in both lists if any.
ECDSA_256k1_Crt_Sig: string = 'D' // ECDSA secp256k1 sig appears in current list.
ECDSA_256r1_Sig: string = "E" // ECDSA secp256r1 sig appears same in both lists if any.
ECDSA_256r1_Crt_Sig: string = "F" // ECDSA secp256r1 sig appears in current list.
Ed448_Sig: string = '0A' // Ed448 signature appears in both lists.
Ed448_Crt_Sig: string = '0B' // Ed448 signature appears in current list only.
Ed25519_Big_Sig: string = '2A' // Ed25519 sig appears in both lists.
Ed25519_Big_Crt_Sig: string = '2B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Big_Sig: string = '2C' // ECDSA secp256k1 sig appears in both lists.
ECDSA_256k1_Big_Crt_Sig: string = '2D' // ECDSA secp256k1 sig appears in current list only.
ECDSA_256r1_Big_Sig: string = "2E" // ECDSA secp256r1 sig appears in both lists.
ECDSA_256r1_Big_Crt_Sig: string = "2F" // ECDSA secp256r1 sig appears in current list only.
Ed448_Big_Sig: string = '3A' // Ed448 signature appears in both lists.
Ed448_Big_Crt_Sig: string = '3B' // Ed448 signature appears in current list only.

Expand All @@ -46,9 +54,11 @@ export const IdxSigDex = new IndexedSigCodex()
export class IndexedCurrentSigCodex {
Ed25519_Crt_Sig: string = 'B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Crt_Sig: string = 'D' // ECDSA secp256k1 sig appears in current list only.
ECDSA_256r1_Crt_Sig: string = "F" // ECDSA secp256r1 sig appears in current list.
Ed448_Crt_Sig: string = '0B' // Ed448 signature appears in current list only.
Ed25519_Big_Crt_Sig: string = '2B' // Ed25519 sig appears in current list only.
ECDSA_256k1_Big_Crt_Sig: string = '2D' // ECDSA secp256k1 sig appears in current list only.
ECDSA_256r1_Big_Crt_Sig: string = "2F" // ECDSA secp256r1 sig appears in current list only.
Ed448_Big_Crt_Sig: string = '3B' // Ed448 signature appears in current list only.

has(prop: string): boolean {
Expand Down Expand Up @@ -117,13 +127,17 @@ export class Indexer {
'B': new Xizage(1, 1, 0, 88, 0),
'C': new Xizage(1, 1, 0, 88, 0),
'D': new Xizage(1, 1, 0, 88, 0),
'E': new Xizage(1, 1, 0, 88, 0),
'F': new Xizage(1, 1, 0, 88, 0),
'0A': new Xizage(2, 2, 1, 156, 0),
'0B': new Xizage(2, 2, 1, 156, 0),

'2A': new Xizage(2, 4, 2, 92, 0),
'2B': new Xizage(2, 4, 2, 92, 0),
'2C': new Xizage(2, 4, 2, 92, 0),
'2D': new Xizage(2, 4, 2, 92, 0),
'2E': new Xizage(2, 4, 2, 92, 0),
'2F': new Xizage(2, 4, 2, 92, 0),

'3A': new Xizage(2, 6, 3, 160, 0),
'3B': new Xizage(2, 6, 3, 160, 0),
Expand Down

0 comments on commit dda0752

Please sign in to comment.