Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
c200822b
Commit
c200822b
authored
Dec 08, 2017
by
garciay
Browse files
Add Brainpool Security support
parent
19e238ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
ttcn/TestCodec/TestCodec_Certificates.ttcn
View file @
c200822b
...
...
@@ -117,7 +117,7 @@ module TestCodec_Certificates {
var
octetstring
v_sig
:=
''
O
;
var
bitstring
v_encMsg
:=
''
B
;
if
(
f_generate_key_pair_
nist
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
if
(
f_generate_key_pair_
brainpool
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
setverdict
(
fail
);
stop
;
}
...
...
@@ -148,7 +148,7 @@ module TestCodec_Certificates {
log
(
"Encode template "
,
valueof
(
v_cert
.
toBeSigned
));
v_encMsg
:=
encvalue
(
v_cert
.
toBeSigned
);
// Sign the certificate using ECDSA/SHA-256 (NIST p-256)
v_sig
:=
f_signWithEcdsa
Nist
p256WithSha256
(
bit2oct
(
v_encMsg
),
v_private_key
);
v_sig
:=
f_signWithEcdsa
Brainpool
p256WithSha256
(
bit2oct
(
v_encMsg
),
v_private_key
);
v_cert
.
signature_
:=
m_signature_ecdsaNistP256
(
m_ecdsaNistP256Signature
(
...
...
@@ -166,7 +166,7 @@ module TestCodec_Certificates {
stop
;
}
v_encMsg
:=
encvalue
(
v_cert_dec
.
toBeSigned
);
if
(
f_verifyWithEcdsa
Nist
p256WithSha256
(
if
(
f_verifyWithEcdsa
Brainpool
p256WithSha256
(
bit2oct
(
v_encMsg
),
v_cert_dec
.
signature_
.
ecdsaNistP256Signature
.
rSig
.
x_only
&
v_cert_dec
.
signature_
.
ecdsaNistP256Signature
.
sSig
,
v_cert_dec
.
toBeSigned
.
verifyKeyIndicator
.
verificationKey
.
ecdsaNistP256
.
uncompressedP256
.
x
,
...
...
ttcn/TestCodec/TestCodec_SecuredFuntions.ttcn
View file @
c200822b
...
...
@@ -313,7 +313,7 @@ module TestCodec_SecuredFuntions {
var
octetstring
v_encMsg
:=
'
0
A0A0102030405060708090A0B0C0D0E0F0A0A
'
O
;
var
octetstring
v_sig
:=
''
O
;
if
(
f_generate_key_pair_
nist
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
if
(
f_generate_key_pair_
brainpool
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
setverdict
(
fail
);
stop
;
}
...
...
@@ -343,7 +343,7 @@ module TestCodec_SecuredFuntions {
var
octetstring
v_encMsg
:=
'
0
A0A0102030405060708090A0B0C0D0E0F0A0A
'
O
;
var
octetstring
v_sig
:=
''
O
;
if
(
f_generate_key_pair_
nist
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
if
(
f_generate_key_pair_
brainpool
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
setverdict
(
fail
);
stop
;
}
...
...
@@ -390,7 +390,7 @@ module TestCodec_SecuredFuntions {
var
Oct32
v_publicKeyX_wrong
;
var
Oct32
v_publicKeyY_wrong
;
if
(
f_generate_key_pair_
nist
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
if
(
f_generate_key_pair_
brainpool
p256
(
v_private_key
,
v_publicKeyX
,
v_publicKeyY
)
==
false
)
{
setverdict
(
fail
);
stop
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment