From cc1c799d4289bda27cdc555a42919650675a27c4 Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Fri, 1 Dec 2023 20:29:02 -0700 Subject: [PATCH] more refinement of new CESR Codes --- src/keri/core/coring.py | 40 ++++++++++++++++++++++----------------- tests/core/test_coring.py | 38 +++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/keri/core/coring.py b/src/keri/core/coring.py index 0da19bca5..f69a96c14 100644 --- a/src/keri/core/coring.py +++ b/src/keri/core/coring.py @@ -423,14 +423,15 @@ class MatterCodex: X25519_Private: str = 'O' # X25519 private decryption key converted from Ed25519 X25519_Cipher_Seed: str = 'P' # X25519 sealed box 124 char b64 Cipher of 44 char qb64 Seed ECDSA_256r1_Seed: str = "Q" # ECDSA secp256r1 256 bit random Seed for private key - Bext3: str = 'R' # Bext3 3 B64 encoded chars for Packet Type, SemVer, Trait like 'DND' - Large: str = 'S' # Large 5 byte b2 number - Tall: str = 'T' # Tall 11 byte b2 number - Great: str = 'U' # Great 14 byte b2 number - Vast: str = 'V' # Vast 17 byte b2 number - Tag1: str = 'W' # Tag1 as one char (bytes) field map label lead size 1 - Tag2: str = 'X' # Tag2 as two char (bytes) field map label lead size 0 - Bext7: str = 'Y' # Bext7 7 B64 encoded chars for packet kind and version KERIVVV + Tall: str = 'R' # Tall 5 byte b2 number + Large: str = 'S' # Large 11 byte b2 number + Great: str = 'T' # Great 14 byte b2 number + Vast: str = 'U' # Vast 17 byte b2 number + Label1: str = 'V' # Label1 as one char (bytes) field map label lead size 1 + Label2: str = 'W' # Label2 as two char (bytes) field map label lead size 0 + Tag1: str = 'X' # Tag1 1 B64 encoded char with pad for 1 char field tag + Tag3: str = 'Y' # Tag3 3 B64 encoded chars for field tag or packet type, semver, trait like 'DND' + Tag7: str = 'Z' # Tag7 7 B64 encoded chars for field tag or packet kind and version KERIVVV Salt_128: str = '0A' # 128 bit random salt or 128 bit number (see Huge) Ed25519_Sig: str = '0B' # Ed25519 signature. ECDSA_256k1_Sig: str = '0C' # ECDSA secp256k1 signature. @@ -440,8 +441,9 @@ class MatterCodex: SHA2_512: str = '0G' # SHA2 512 bit digest self-addressing derivation. Long: str = '0H' # Long 4 byte b2 number ECDSA_256r1_Sig: str = '0I' # ECDSA secp256r1 signature. - Bext2: str = '0J' # Bext2 2 B64 encoded chars for trait like 'EO' CESR native msg protocol version - Bext6: str = '0K' # Bext6 6 B64 encoded chars for protocol kind version like KERIVV (KERI 1.1) or KKKVVV (KERI 1.1.0) + Tag2: str = '0J' # Tag2 2 B64 encoded chars for field tag or version VV or trait like 'EO' + Tag5: str = '0K' # Tag5 5 B64 encoded chars with pad for field tag or version or trait like 'EO' + Tag6: str = '0L' # Tag6 6 B64 encoded chars for field tag or protocol kind version like KERIVV (KERI 1.1) or KKKVVV ECDSA_256k1N: str = '1AAA' # ECDSA secp256k1 verification key non-transferable, basic derivation. ECDSA_256k1: str = '1AAB' # ECDSA public verification or encryption key, basic derivation Ed448N: str = '1AAC' # Ed448 non-transferable prefix public signing verification key. Basic derivation. @@ -453,6 +455,7 @@ class MatterCodex: ECDSA_256r1N: str = '1AAI' # ECDSA secp256r1 verification key non-transferable, basic derivation. ECDSA_256r1: str = '1AAJ' # ECDSA secp256r1 verification or encryption key, basic derivation Null: str = '1AAK' # Null None or empty value + Tag4: str = '1AAL' # Tag4 4 B64 encoded chars for field tag or packet type, TBD1: str = '2AAA' # Testing purposes only fixed with lead size 1 TBD2: str = '3AAA' # Testing purposes only of fixed with lead size 2 StrB64_L0: str = '4A' # String Base64 only lead size 0 @@ -780,14 +783,15 @@ class Matter: 'O': Sizage(hs=1, ss=0, fs=44, ls=0), 'P': Sizage(hs=1, ss=0, fs=124, ls=0), 'Q': Sizage(hs=1, ss=0, fs=44, ls=0), - 'R': Sizage(hs=1, ss=0, fs=4, ls=0), - 'S': Sizage(hs=1, ss=0, fs=8, ls=0), - 'T': Sizage(hs=1, ss=0, fs=16, ls=0), - 'U': Sizage(hs=1, ss=0, fs=20, ls=0), - 'V': Sizage(hs=1, ss=0, fs=24, ls=0), - 'W': Sizage(hs=1, ss=0, fs=4, ls=1), + 'R': Sizage(hs=1, ss=0, fs=8, ls=0), + 'S': Sizage(hs=1, ss=0, fs=16, ls=0), + 'T': Sizage(hs=1, ss=0, fs=20, ls=0), + 'U': Sizage(hs=1, ss=0, fs=24, ls=0), + 'V': Sizage(hs=1, ss=0, fs=4, ls=1), + 'W': Sizage(hs=1, ss=0, fs=4, ls=0), 'X': Sizage(hs=1, ss=0, fs=4, ls=0), - 'Y': Sizage(hs=1, ss=0, fs=8, ls=0), + 'Y': Sizage(hs=1, ss=0, fs=4, ls=0), + 'Z': Sizage(hs=1, ss=0, fs=8, ls=0), '0A': Sizage(hs=2, ss=0, fs=24, ls=0), '0B': Sizage(hs=2, ss=0, fs=88, ls=0), '0C': Sizage(hs=2, ss=0, fs=88, ls=0), @@ -799,6 +803,7 @@ class Matter: '0I': Sizage(hs=2, ss=0, fs=88, ls=0), '0J': Sizage(hs=2, ss=0, fs=4, ls=0), '0K': Sizage(hs=2, ss=0, fs=8, ls=0), + '0L': Sizage(hs=2, ss=0, fs=8, ls=0), '1AAA': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAB': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAC': Sizage(hs=4, ss=0, fs=80, ls=0), @@ -810,6 +815,7 @@ class Matter: '1AAI': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAJ': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAK': Sizage(hs=4, ss=0, fs=4, ls=0), + '1AAL': Sizage(hs=4, ss=0, fs=8, ls=0), '2AAA': Sizage(hs=4, ss=0, fs=8, ls=1), '3AAA': Sizage(hs=4, ss=0, fs=8, ls=2), '4A': Sizage(hs=2, ss=2, fs=None, ls=0), diff --git a/tests/core/test_coring.py b/tests/core/test_coring.py index fec5bb7ee..cb492583c 100644 --- a/tests/core/test_coring.py +++ b/tests/core/test_coring.py @@ -365,14 +365,15 @@ def test_matter(): 'X25519_Private': 'O', 'X25519_Cipher_Seed': 'P', 'ECDSA_256r1_Seed': 'Q', - 'Bext3': 'R', + 'Tall': 'R', 'Large': 'S', - 'Tall': 'T', - 'Great': 'U', - 'Vast': 'V', - 'Tag1': 'W', - 'Tag2': 'X', - 'Bext7': 'Y', + 'Great': 'T', + 'Vast': 'U', + 'Label1': 'V', + 'Label2': 'W', + 'Tag1': 'X', + 'Tag3': 'Y', + 'Tag7': 'Z', 'Salt_128': '0A', 'Ed25519_Sig': '0B', 'ECDSA_256k1_Sig': '0C', @@ -382,8 +383,9 @@ def test_matter(): 'SHA2_512': '0G', 'Long': '0H', 'ECDSA_256r1_Sig': '0I', - 'Bext2': '0J', - 'Bext6': '0K', + 'Tag2': '0J', + 'Tag5': '0K', + 'Tag6': '0L', 'ECDSA_256k1N': '1AAA', 'ECDSA_256k1': '1AAB', 'Ed448N': '1AAC', @@ -395,6 +397,7 @@ def test_matter(): 'ECDSA_256r1N': '1AAI', 'ECDSA_256r1': '1AAJ', 'Null': '1AAK', + 'Tag4': '1AAL', 'TBD1': '2AAA', 'TBD2': '3AAA', 'StrB64_L0': '4A', @@ -451,14 +454,15 @@ def test_matter(): 'O': Sizage(hs=1, ss=0, fs=44, ls=0), 'P': Sizage(hs=1, ss=0, fs=124, ls=0), 'Q': Sizage(hs=1, ss=0, fs=44, ls=0), - 'R': Sizage(hs=1, ss=0, fs=4, ls=0), - 'S': Sizage(hs=1, ss=0, fs=8, ls=0), - 'T': Sizage(hs=1, ss=0, fs=16, ls=0), - 'U': Sizage(hs=1, ss=0, fs=20, ls=0), - 'V': Sizage(hs=1, ss=0, fs=24, ls=0), - 'W': Sizage(hs=1, ss=0, fs=4, ls=1), + 'R': Sizage(hs=1, ss=0, fs=8, ls=0), + 'S': Sizage(hs=1, ss=0, fs=16, ls=0), + 'T': Sizage(hs=1, ss=0, fs=20, ls=0), + 'U': Sizage(hs=1, ss=0, fs=24, ls=0), + 'V': Sizage(hs=1, ss=0, fs=4, ls=1), + 'W': Sizage(hs=1, ss=0, fs=4, ls=0), 'X': Sizage(hs=1, ss=0, fs=4, ls=0), - 'Y': Sizage(hs=1, ss=0, fs=8, ls=0), + 'Y': Sizage(hs=1, ss=0, fs=4, ls=0), + 'Z': Sizage(hs=1, ss=0, fs=8, ls=0), '0A': Sizage(hs=2, ss=0, fs=24, ls=0), '0B': Sizage(hs=2, ss=0, fs=88, ls=0), '0C': Sizage(hs=2, ss=0, fs=88, ls=0), @@ -470,6 +474,7 @@ def test_matter(): '0I': Sizage(hs=2, ss=0, fs=88, ls=0), '0J': Sizage(hs=2, ss=0, fs=4, ls=0), '0K': Sizage(hs=2, ss=0, fs=8, ls=0), + '0L': Sizage(hs=2, ss=0, fs=8, ls=0), '1AAA': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAB': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAC': Sizage(hs=4, ss=0, fs=80, ls=0), @@ -481,6 +486,7 @@ def test_matter(): '1AAI': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAJ': Sizage(hs=4, ss=0, fs=48, ls=0), '1AAK': Sizage(hs=4, ss=0, fs=4, ls=0), + '1AAL': Sizage(hs=4, ss=0, fs=8, ls=0), '2AAA': Sizage(hs=4, ss=0, fs=8, ls=1), '3AAA': Sizage(hs=4, ss=0, fs=8, ls=2), '4A': Sizage(hs=2, ss=2, fs=None, ls=0),