Commits (1)
...@@ -591,12 +591,12 @@ module LibItsPki_Functions { ...@@ -591,12 +591,12 @@ module LibItsPki_Functions {
if (PX_VE_ALG == e_nist_p256) { if (PX_VE_ALG == e_nist_p256) {
return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey);
} else if (PX_VE_ALG == e_brainpool_p256_r1) { } else if (PX_VE_ALG == e_brainpool_p256_r1) {
return f_signWithEcdsaBrainpoolp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); return f_signWithEcdsaBrainpoolp256r1WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey);
} else if (PX_VE_ALG == e_brainpool_p384_r1) { } else if (PX_VE_ALG == e_brainpool_p384_r1) {
if (p_certificateIssuer == int2oct(0, 32)) { if (p_certificateIssuer == int2oct(0, 32)) {
return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey);
} else { } else {
return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey);
} }
} }
...@@ -634,14 +634,14 @@ module LibItsPki_Functions { ...@@ -634,14 +634,14 @@ module LibItsPki_Functions {
} }
} else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) { } else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) {
if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) { if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) {
v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256(
p_tbs, p_tbs,
p_issuer, p_issuer,
p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig,
p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0, p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0,
0); 0);
} else { } else {
v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256(
p_tbs, p_tbs,
p_issuer, p_issuer,
p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig,
...@@ -650,14 +650,14 @@ module LibItsPki_Functions { ...@@ -650,14 +650,14 @@ module LibItsPki_Functions {
} }
} else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) { } else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) {
if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) { if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) {
v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384(
p_tbs, p_tbs,
p_issuer, p_issuer,
p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig,
p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0, p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0,
0); 0);
} else { } else {
v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384(
p_tbs, p_tbs,
p_issuer, p_issuer,
p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig,
...@@ -2300,7 +2300,7 @@ module LibItsPki_Functions { ...@@ -2300,7 +2300,7 @@ module LibItsPki_Functions {
// In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted
if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) {
v_hashId := sha384; v_hashId := sha384;
v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key);
v_signature := valueof( v_signature := valueof(
m_signature_ecdsaBrainpoolP384r1( m_signature_ecdsaBrainpoolP384r1(
m_ecdsaP384Signature( m_ecdsaP384Signature(
...@@ -2314,7 +2314,7 @@ module LibItsPki_Functions { ...@@ -2314,7 +2314,7 @@ module LibItsPki_Functions {
} else { } else {
v_hashId := sha256; v_hashId := sha256;
if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) {
v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key);
v_signature := valueof( v_signature := valueof(
m_signature_ecdsaBrainpoolP256r1( m_signature_ecdsaBrainpoolP256r1(
m_ecdsaP256Signature( m_ecdsaP256Signature(
...@@ -2405,7 +2405,7 @@ module LibItsPki_Functions { ...@@ -2405,7 +2405,7 @@ module LibItsPki_Functions {
log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant");
return false; return false;
} }
v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce);
if (v_public_compressed_ephemeral_mode == 0) { if (v_public_compressed_ephemeral_mode == 0) {
v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key));
} else { } else {
...@@ -2687,7 +2687,7 @@ module LibItsPki_Functions { ...@@ -2687,7 +2687,7 @@ module LibItsPki_Functions {
// TODO Simplify with f_signWithEcdsa // TODO Simplify with f_signWithEcdsa
if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) {
v_hashId := sha384; v_hashId := sha384;
v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key);
v_signature := valueof( v_signature := valueof(
m_signature_ecdsaBrainpoolP384r1( m_signature_ecdsaBrainpoolP384r1(
m_ecdsaP384Signature( m_ecdsaP384Signature(
...@@ -2701,7 +2701,7 @@ module LibItsPki_Functions { ...@@ -2701,7 +2701,7 @@ module LibItsPki_Functions {
} else { } else {
v_hashId := sha256; v_hashId := sha256;
if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) {
v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key);
v_signature := valueof( v_signature := valueof(
m_signature_ecdsaBrainpoolP256r1( m_signature_ecdsaBrainpoolP256r1(
m_ecdsaP256Signature( m_ecdsaP256Signature(
...@@ -2791,7 +2791,7 @@ module LibItsPki_Functions { ...@@ -2791,7 +2791,7 @@ module LibItsPki_Functions {
log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant");
return false; return false;
} }
v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce);
if (v_public_compressed_ephemeral_mode == 0) { if (v_public_compressed_ephemeral_mode == 0) {
v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key));
} else { } else {
...@@ -3456,7 +3456,7 @@ module LibItsPki_Functions { ...@@ -3456,7 +3456,7 @@ module LibItsPki_Functions {
if (p_enc_algorithm == e_nist_p256) { if (p_enc_algorithm == e_nist_p256) {
v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else if (p_enc_algorithm == e_brainpool_p256_r1) { } else if (p_enc_algorithm == e_brainpool_p256_r1) {
v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else { } else {
log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant");
return false; return false;
...@@ -3568,7 +3568,7 @@ module LibItsPki_Functions { ...@@ -3568,7 +3568,7 @@ module LibItsPki_Functions {
if (p_enc_algorithm == e_nist_p256) { if (p_enc_algorithm == e_nist_p256) {
v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else if (p_enc_algorithm == e_brainpool_p256_r1) { } else if (p_enc_algorithm == e_brainpool_p256_r1) {
v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else { } else {
log("f_build_pki_secured_request_message: Wrong encryption variant"); log("f_build_pki_secured_request_message: Wrong encryption variant");
return false; return false;
...@@ -3672,7 +3672,7 @@ module LibItsPki_Functions { ...@@ -3672,7 +3672,7 @@ module LibItsPki_Functions {
if (p_enc_algorithm == e_nist_p256) { if (p_enc_algorithm == e_nist_p256) {
v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else if (p_enc_algorithm == e_brainpool_p256_r1) { } else if (p_enc_algorithm == e_brainpool_p256_r1) {
v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce);
} else { } else {
log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant");
return false; return false;
......
...@@ -87,18 +87,18 @@ module LibItsSecurity_Functions { ...@@ -87,18 +87,18 @@ module LibItsSecurity_Functions {
* @param p_privateKey The private key for signature * @param p_privateKey The private key for signature
* @return The signature value * @return The signature value
*/ */
function f_signWithEcdsaBrainpoolp256WithSha256( function f_signWithEcdsaBrainpoolp256r1WithSha256(
in octetstring p_toBeSignedSecuredMessage, in octetstring p_toBeSignedSecuredMessage,
in Oct32 p_certificateIssuer, in Oct32 p_certificateIssuer,
in Oct32 p_privateKey in Oct32 p_privateKey
) return octetstring { ) return octetstring {
return fx_signWithEcdsaBrainpoolp256WithSha256( return fx_signWithEcdsaBrainpoolp256r1WithSha256(
p_toBeSignedSecuredMessage, p_toBeSignedSecuredMessage,
p_certificateIssuer, p_certificateIssuer,
p_privateKey p_privateKey
); );
} // End of function f_signWithEcdsaBrainpoolp256WithSha256 } // End of function f_signWithEcdsaBrainpoolp256r1WithSha256
/** /**
* @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2
...@@ -107,21 +107,21 @@ module LibItsSecurity_Functions { ...@@ -107,21 +107,21 @@ module LibItsSecurity_Functions {
* @param p_privateKey The private key for signature * @param p_privateKey The private key for signature
* @return The signature value * @return The signature value
*/ */
function f_signWithEcdsaBrainpoolp384WithSha384( function f_signWithEcdsaBrainpoolp384r1WithSha384(
in octetstring p_toBeSignedSecuredMessage, in octetstring p_toBeSignedSecuredMessage,
in Oct48 p_certificateIssuer, in Oct48 p_certificateIssuer,
in Oct48 p_privateKey in Oct48 p_privateKey
) return octetstring { ) return octetstring {
log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_toBeSignedSecuredMessage); log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_toBeSignedSecuredMessage);
log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_certificateIssuer); log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_certificateIssuer);
log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_privateKey); log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_privateKey);
return fx_signWithEcdsaBrainpoolp384WithSha384( return fx_signWithEcdsaBrainpoolp384r1WithSha384(
p_toBeSignedSecuredMessage, p_toBeSignedSecuredMessage,
p_certificateIssuer, p_certificateIssuer,
p_privateKey p_privateKey
); );
} // End of function f_signWithEcdsaBrainpoolp384WithSha384 } // End of function f_signWithEcdsaBrainpoolp384r1WithSha384
function f_decrypt( function f_decrypt(
in octetstring p_encryptPrivateKey, in octetstring p_encryptPrivateKey,
...@@ -201,7 +201,7 @@ module LibItsSecurity_Functions { ...@@ -201,7 +201,7 @@ module LibItsSecurity_Functions {
} else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) {
var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext;
if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) {
v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256(
v_ciphertext.aes128ccm.ccmCiphertext, v_ciphertext.aes128ccm.ccmCiphertext,
p_encryptPrivateKey, p_encryptPrivateKey,
v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0,
...@@ -212,7 +212,7 @@ module LibItsSecurity_Functions { ...@@ -212,7 +212,7 @@ module LibItsSecurity_Functions {
p_salt, p_aes_sym_enc_key p_salt, p_aes_sym_enc_key
); );
} else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) {
v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256(
v_ciphertext.aes128ccm.ccmCiphertext, v_ciphertext.aes128ccm.ccmCiphertext,
p_encryptPrivateKey, p_encryptPrivateKey,
v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1,
...@@ -344,7 +344,7 @@ module LibItsSecurity_Functions { ...@@ -344,7 +344,7 @@ module LibItsSecurity_Functions {
* @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/
* @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf
*/ */
function f_encryptWithEciesBrainpoolp256WithSha256( function f_encryptWithEciesBrainpoolp256r1WithSha256(
in octetstring p_toBeEncryptedSecuredMessage, in octetstring p_toBeEncryptedSecuredMessage,
in Oct32 p_recipientsPublicKeyCompressed, in Oct32 p_recipientsPublicKeyCompressed,
in integer p_compressed_mode, in integer p_compressed_mode,
...@@ -356,7 +356,7 @@ module LibItsSecurity_Functions { ...@@ -356,7 +356,7 @@ module LibItsSecurity_Functions {
out Oct16 p_authentication_vector, out Oct16 p_authentication_vector,
out Oct12 p_nonce out Oct12 p_nonce
) return octetstring { ) return octetstring {
return fx_encryptWithEciesBrainpoolp256WithSha256( return fx_encryptWithEciesBrainpoolp256r1WithSha256(
p_toBeEncryptedSecuredMessage, p_toBeEncryptedSecuredMessage,
p_recipientsPublicKeyCompressed, p_recipientsPublicKeyCompressed,
p_compressed_mode, p_compressed_mode,
...@@ -368,7 +368,7 @@ module LibItsSecurity_Functions { ...@@ -368,7 +368,7 @@ module LibItsSecurity_Functions {
p_authentication_vector, p_authentication_vector,
p_nonce p_nonce
); );
} // End of function f_encryptWithEciesBrainpoolp256WithSha256 } // End of function f_encryptWithEciesBrainpoolp256r1WithSha256
/** /**
* @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm
...@@ -383,7 +383,7 @@ module LibItsSecurity_Functions { ...@@ -383,7 +383,7 @@ module LibItsSecurity_Functions {
* @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/
* @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf
*/ */
function f_decryptWithEciesBrainpoolp256WithSha256( function f_decryptWithEciesBrainpoolp256r1WithSha256(
in octetstring p_encryptedSecuredMessage, in octetstring p_encryptedSecuredMessage,
in Oct32 p_privateEncKey, in Oct32 p_privateEncKey,
in Oct32 p_publicEphemeralKeyCompressed, in Oct32 p_publicEphemeralKeyCompressed,
...@@ -394,7 +394,7 @@ module LibItsSecurity_Functions { ...@@ -394,7 +394,7 @@ module LibItsSecurity_Functions {
in Oct32 p_salt, in Oct32 p_salt,
out Oct16 p_aes_sym_enc_key out Oct16 p_aes_sym_enc_key
) return octetstring { ) return octetstring {
return fx_decryptWithEciesBrainpoolp256WithSha256( return fx_decryptWithEciesBrainpoolp256r1WithSha256(
p_encryptedSecuredMessage, p_encryptedSecuredMessage,
p_privateEncKey, p_privateEncKey,
p_publicEphemeralKeyCompressed, p_publicEphemeralKeyCompressed,
...@@ -405,7 +405,7 @@ module LibItsSecurity_Functions { ...@@ -405,7 +405,7 @@ module LibItsSecurity_Functions {
p_salt, p_salt,
p_aes_sym_enc_key p_aes_sym_enc_key
); );
} // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 } // End of function f_decryptWithEcdsaBrainpoolp256r1WithSha256
/** /**
* @desc Compute the HashedId8 value from the hash value * @desc Compute the HashedId8 value from the hash value
...@@ -510,25 +510,25 @@ module LibItsSecurity_Functions { ...@@ -510,25 +510,25 @@ module LibItsSecurity_Functions {
* @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
function f_verifyWithEcdsaBrainpoolp256WithSha256( function f_verifyWithEcdsaBrainpoolp256r1WithSha256(
in octetstring p_toBeVerifiedData, in octetstring p_toBeVerifiedData,
in Oct32 p_certificateIssuer, in Oct32 p_certificateIssuer,
in Oct64 p_signature, in Oct64 p_signature,
in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed,
in integer p_compressed_mode in integer p_compressed_mode
) return boolean { ) return boolean {
log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData);
log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData));
log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature);
log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed);
return fx_verifyWithEcdsaBrainpoolp256WithSha256( return fx_verifyWithEcdsaBrainpoolp256r1WithSha256(
p_toBeVerifiedData, p_toBeVerifiedData,
p_certificateIssuer, p_certificateIssuer,
p_signature, p_signature,
p_ecdsaBrainpoolp256PublicKeyCompressed, p_ecdsaBrainpoolp256PublicKeyCompressed,
p_compressed_mode p_compressed_mode
); );
} // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256
/** /**
* @Desc Verify the signature of the specified data * @Desc Verify the signature of the specified data
...@@ -539,25 +539,25 @@ module LibItsSecurity_Functions { ...@@ -539,25 +539,25 @@ module LibItsSecurity_Functions {
* @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate)
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( // TODO To be removed
in octetstring p_toBeVerifiedData, in octetstring p_toBeVerifiedData,
in Oct32 p_certificateIssuer, in Oct32 p_certificateIssuer,
in Oct64 p_signature, in Oct64 p_signature,
in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyX,
in Oct32 p_ecdsaBrainpoolp256PublicKeyY in Oct32 p_ecdsaBrainpoolp256PublicKeyY
) return boolean { ) return boolean {
// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData);
// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData));
// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); // log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature);
// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); // log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX);
// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); // log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY);
return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( return fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1(
p_toBeVerifiedData, p_toBeVerifiedData,
p_certificateIssuer, p_certificateIssuer,
p_signature, p_signature,
p_ecdsaBrainpoolp256PublicKeyX, p_ecdsaBrainpoolp256PublicKeyX,
p_ecdsaBrainpoolp256PublicKeyY); p_ecdsaBrainpoolp256PublicKeyY);
} // End of function f_verifyWithEcdsaBrainpoolp256WithSha256_1 } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1
/** /**
* @Desc Verify the signature of the specified data * @Desc Verify the signature of the specified data
...@@ -569,25 +569,25 @@ module LibItsSecurity_Functions { ...@@ -569,25 +569,25 @@ module LibItsSecurity_Functions {
* @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
function f_verifyWithEcdsaBrainpoolp384WithSha384( function f_verifyWithEcdsaBrainpoolp384r1WithSha384(
in octetstring p_toBeVerifiedData, in octetstring p_toBeVerifiedData,
in Oct48 p_certificateIssuer, in Oct48 p_certificateIssuer,
in Oct96 p_signature, in Oct96 p_signature,
in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed,
in integer p_compressed_mode in integer p_compressed_mode
) return boolean { ) return boolean {
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData);
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData));
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature);
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed);
return fx_verifyWithEcdsaBrainpoolp384WithSha384( return fx_verifyWithEcdsaBrainpoolp384r1WithSha384(
p_toBeVerifiedData, p_toBeVerifiedData,
p_certificateIssuer, p_certificateIssuer,
p_signature, p_signature,
p_ecdsaBrainpoolp384PublicKeyCompressed, p_ecdsaBrainpoolp384PublicKeyCompressed,
p_compressed_mode p_compressed_mode
); );
} // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384
/** /**
* @Desc Verify the signature of the specified data * @Desc Verify the signature of the specified data
...@@ -598,25 +598,25 @@ module LibItsSecurity_Functions { ...@@ -598,25 +598,25 @@ module LibItsSecurity_Functions {
* @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate)
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( // TODO To be removed
in octetstring p_toBeVerifiedData, in octetstring p_toBeVerifiedData,
in Oct48 p_certificateIssuer, in Oct48 p_certificateIssuer,
in Oct96 p_signature, in Oct96 p_signature,
in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyX,
in Oct48 p_ecdsaBrainpoolp384PublicKeyY in Oct48 p_ecdsaBrainpoolp384PublicKeyY
) return boolean { ) return boolean {
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData);
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData));
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature);
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX);
// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); // log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY);
return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( return fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1(
p_toBeVerifiedData, p_toBeVerifiedData,
p_certificateIssuer, p_certificateIssuer,
p_signature, p_signature,
p_ecdsaBrainpoolp384PublicKeyX, p_ecdsaBrainpoolp384PublicKeyX,
p_ecdsaBrainpoolp384PublicKeyY); p_ecdsaBrainpoolp384PublicKeyY);
} // End of function f_verifyWithEcdsaBrainpoolp384WithSha384_1 } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1
/** /**
* @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm.
...@@ -849,7 +849,7 @@ module LibItsSecurity_Functions { ...@@ -849,7 +849,7 @@ module LibItsSecurity_Functions {
) )
)); ));
} else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) {
v_signature := f_signWithEcdsaBrainpoolp256WithSha256( v_signature := f_signWithEcdsaBrainpoolp256r1WithSha256(
v_secPayload, v_secPayload,
v_certificateIssuer, v_certificateIssuer,
v_privateKey v_privateKey
...@@ -861,7 +861,7 @@ module LibItsSecurity_Functions { ...@@ -861,7 +861,7 @@ module LibItsSecurity_Functions {
) )
)); ));
} else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) {
v_signature := f_signWithEcdsaBrainpoolp384WithSha384( v_signature := f_signWithEcdsaBrainpoolp384r1WithSha384(
v_secPayload, v_secPayload,
v_certificateIssuer, v_certificateIssuer,
v_privateKey v_privateKey
...@@ -1629,7 +1629,7 @@ module LibItsSecurity_Functions { ...@@ -1629,7 +1629,7 @@ module LibItsSecurity_Functions {
v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig);
log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature);
if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) {
return f_verifyWithEcdsaBrainpoolp256WithSha256_1( return f_verifyWithEcdsaBrainpoolp256r1WithSha256_1(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1637,7 +1637,7 @@ module LibItsSecurity_Functions { ...@@ -1637,7 +1637,7 @@ module LibItsSecurity_Functions {
valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y)
); );
} else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) {
return f_verifyWithEcdsaBrainpoolp256WithSha256( return f_verifyWithEcdsaBrainpoolp256r1WithSha256(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1645,7 +1645,7 @@ module LibItsSecurity_Functions { ...@@ -1645,7 +1645,7 @@ module LibItsSecurity_Functions {
0 // Latest bit of the Y-coordinate is 0 0 // Latest bit of the Y-coordinate is 0
); );
} else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) {
return f_verifyWithEcdsaBrainpoolp256WithSha256( return f_verifyWithEcdsaBrainpoolp256r1WithSha256(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1674,7 +1674,7 @@ module LibItsSecurity_Functions { ...@@ -1674,7 +1674,7 @@ module LibItsSecurity_Functions {
v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig);
log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature);
if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) {
return f_verifyWithEcdsaBrainpoolp384WithSha384_1( return f_verifyWithEcdsaBrainpoolp384r1WithSha384_1(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1682,7 +1682,7 @@ module LibItsSecurity_Functions { ...@@ -1682,7 +1682,7 @@ module LibItsSecurity_Functions {
valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y)
); );
} else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) {
return f_verifyWithEcdsaBrainpoolp384WithSha384( return f_verifyWithEcdsaBrainpoolp384r1WithSha384(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1690,7 +1690,7 @@ module LibItsSecurity_Functions { ...@@ -1690,7 +1690,7 @@ module LibItsSecurity_Functions {
0 // Latest bit of the Y-coordinate is 0 0 // Latest bit of the Y-coordinate is 0
); );
} else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) {
return f_verifyWithEcdsaBrainpoolp384WithSha384( return f_verifyWithEcdsaBrainpoolp384r1WithSha384(
v_enc_msg, v_enc_msg,
v_issuer, v_issuer,
v_signature, v_signature,
...@@ -1880,7 +1880,7 @@ module LibItsSecurity_Functions { ...@@ -1880,7 +1880,7 @@ module LibItsSecurity_Functions {
v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig);
log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData);
if (ischosen(p_publicKey.uncompressedP256)) { if (ischosen(p_publicKey.uncompressedP256)) {
v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256_1(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -1888,7 +1888,7 @@ module LibItsSecurity_Functions { ...@@ -1888,7 +1888,7 @@ module LibItsSecurity_Functions {
valueof(p_publicKey.uncompressedP256.y) valueof(p_publicKey.uncompressedP256.y)
); );
} else if (ischosen(p_publicKey.compressed_y_0)) { } else if (ischosen(p_publicKey.compressed_y_0)) {
v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -1896,7 +1896,7 @@ module LibItsSecurity_Functions { ...@@ -1896,7 +1896,7 @@ module LibItsSecurity_Functions {
0 0
); );
} else if (ischosen(p_publicKey.compressed_y_1)) { } else if (ischosen(p_publicKey.compressed_y_1)) {
v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -1944,7 +1944,7 @@ module LibItsSecurity_Functions { ...@@ -1944,7 +1944,7 @@ module LibItsSecurity_Functions {
v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig);
log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData);
if (ischosen(p_publicKey.uncompressedP384)) { if (ischosen(p_publicKey.uncompressedP384)) {
v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384_1(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -1952,7 +1952,7 @@ module LibItsSecurity_Functions { ...@@ -1952,7 +1952,7 @@ module LibItsSecurity_Functions {
valueof(p_publicKey.uncompressedP384.y) valueof(p_publicKey.uncompressedP384.y)
); );
} else if (ischosen(p_publicKey.compressed_y_0)) { } else if (ischosen(p_publicKey.compressed_y_0)) {
v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -1960,7 +1960,7 @@ module LibItsSecurity_Functions { ...@@ -1960,7 +1960,7 @@ module LibItsSecurity_Functions {
0 0
); );
} else if (ischosen(p_publicKey.compressed_y_1)) { } else if (ischosen(p_publicKey.compressed_y_1)) {
v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384(
v_secPayload, v_secPayload,
valueof(p_certificateIssuer), valueof(p_certificateIssuer),
v_signedData, v_signedData,
...@@ -2463,7 +2463,7 @@ module LibItsSecurity_Functions { ...@@ -2463,7 +2463,7 @@ module LibItsSecurity_Functions {
* @param p_privateKey The private key for signature * @param p_privateKey The private key for signature
* @return The signature value * @return The signature value
*/ */
external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; external function fx_signWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring;
/** /**
* @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature
...@@ -2471,7 +2471,7 @@ module LibItsSecurity_Functions { ...@@ -2471,7 +2471,7 @@ module LibItsSecurity_Functions {
* @param p_privateKey The private key for signature * @param p_privateKey The private key for signature
* @return The signature value * @return The signature value
*/ */
external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; external function fx_signWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring;
/** /**
* @desc Verify the signature of the specified data * @desc Verify the signature of the specified data
...@@ -2504,7 +2504,7 @@ module LibItsSecurity_Functions { ...@@ -2504,7 +2504,7 @@ module LibItsSecurity_Functions {
* @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean;
/** /**
* @desc Verify the signature of the specified data * @desc Verify the signature of the specified data
...@@ -2515,7 +2515,7 @@ module LibItsSecurity_Functions { ...@@ -2515,7 +2515,7 @@ module LibItsSecurity_Functions {
* @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate)
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean;
/** /**
* @desc Verify the signature of the specified data * @desc Verify the signature of the specified data
...@@ -2526,7 +2526,7 @@ module LibItsSecurity_Functions { ...@@ -2526,7 +2526,7 @@ module LibItsSecurity_Functions {
* @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean;
/** /**
* @desc Verify the signature of the specified data * @desc Verify the signature of the specified data
...@@ -2537,7 +2537,7 @@ module LibItsSecurity_Functions { ...@@ -2537,7 +2537,7 @@ module LibItsSecurity_Functions {
* @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate)
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean;
/** /**
* @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm.
...@@ -2648,9 +2648,9 @@ module LibItsSecurity_Functions { ...@@ -2648,9 +2648,9 @@ module LibItsSecurity_Functions {
* @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption
* @return The encrypted message * @return The encrypted message
*/ */
external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; external function fx_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring;
external function fx_test_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; external function fx_test_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring;
/** /**
* @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm
...@@ -2662,7 +2662,7 @@ module LibItsSecurity_Functions { ...@@ -2662,7 +2662,7 @@ module LibItsSecurity_Functions {
* @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption
* @return The decrypted message * @return The decrypted message
*/ */
external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; external function fx_decryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring;
} // End of group encryption } // End of group encryption
......