tor-llcrypto: Add test case for RsaIdentity formatting
I'm going to change the code that does this, so add a test first to check the output doesn't change. At some point we should have more RSA tests.
This commit is contained in:
parent
f7009e238a
commit
7a4369e240
|
@ -37,6 +37,25 @@ fn test_ed25519_identity() {
|
|||
assert_eq!(ex3.as_bytes(), &example_key[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rsa_formatting() {
|
||||
use ll::pk::rsa::RsaIdentity;
|
||||
|
||||
let id = hex::decode("5696ab38cb3852afa476a5c07b2d4788963d5567").unwrap();
|
||||
let id = RsaIdentity::from_bytes(&id).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
format!("<<{}>>", id),
|
||||
"<<$5696ab38cb3852afa476a5c07b2d4788963d5567>>"
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{:?}", id),
|
||||
"RsaIdentity { $5696ab38cb3852afa476a5c07b2d4788963d5567 }"
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Proper tests for RSA keys
|
||||
|
||||
#[test]
|
||||
fn batch_verify() {
|
||||
use ll::pk::ed25519::*;
|
||||
|
|
Loading…
Reference in New Issue