Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ASN.1 REAL type #4

Open
rmhrisk opened this issue May 2, 2014 · 5 comments
Open

Add support for ASN.1 REAL type #4

rmhrisk opened this issue May 2, 2014 · 5 comments
Assignees

Comments

@rmhrisk
Copy link
Contributor

rmhrisk commented May 2, 2014

The REAL type is not used all that commonly but the library does not currently support it, it should. REALs are a machine representation of a real number.

@YuryStrozhevsky YuryStrozhevsky self-assigned this May 2, 2014
@JanFellner
Copy link

Anybody made some improvement in a fork?

@YuryStrozhevsky
Copy link
Contributor

@JanFellner In you do need ASN.1 REAL type you can you predecessor of the ASN1.js - father of ASN1.js. It is on C++, btw. Since I left PeculiarVetures team do not think anybody will append REAL in ASN1.js.

@JanFellner
Copy link

I did fork the library and i am trying to see if i get AsnReal implemented based on the way AsnInteger is coded.
On the c++ side we are using the snacc compiler which we extended so that it is able to create not only strucutres but also a ROSE like RPC interface to call functions. This compiler was extended serveral times and is also able to created JSON typescript stubs and structures. Due to the overhead of JSON i wanted to give BER on the browser a chance but i need Real values as some values are encoded that way on the server side.
I need to get debugging working on monday so that i can encode and decode AsnReal values and step through the code. The structure of the library looks promising to me. Should be duable :)

@JanFellner
Copy link

JanFellner commented Oct 27, 2022

@YuryStrozhevsky i am progressing concerning the real encoding. I read the X690 documentation as well as your "ASN.1 by simple words" which is pretty understandable (thanks for this document 😉)

I am trying to connect asn1js to messages created and parsed by the snacc compiler. As you seem to be pretty long in the asn1 topic you may also have humbled over it.
https://github.com/petesh/snacc/blob/master/c%2B%2B-lib/src/asn-real.C

The X690 states to use two complements values for the exponent,
https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.690-202102-I!!PDF-E&type=items
8.5.7.4

I see that asn1js is providing methods to encode to and decode from two complement values.
The interesting thing is: Your document is not loosing a word about this (neither for the integer values nor for the real values)

I am kind of struggeling here as:

Maybe i am missing the puzzle piece that completes my picture.

(For completeness the FeatureBranch i am working on to get it "real":
https://github.com/JanFellner/ASN1.js/blob/feature/CC-2490-add-support-for-asn1Real/src/internals/LocalRealValueBlock.ts)

@JanFellner
Copy link

For those looking for the missing real encoding decoding take a look at

#79

respectively

https://github.com/ESTOS/ASN1.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants