[riot-devel] [BLE] Random 48-bit address generation

Florent-Valéry Coen florent.coen at gmail.com
Wed Jun 15 16:15:51 CEST 2016


Thanks to all of you for your help! Generating a hash based on the CPU ID
seems like a great solution.

@Brett My understanding of the BLE specs was that a device was allowed to
use a random address rather than a public one, thus effectively bypassing
the need of an OUI (volume 6, part B, section 1.3). Did I misunderstood?
In any case I should definitely stay clear of the reserved range, thanks
for pointing that out!

Best regards,

Florent

2016-06-15 15:36 GMT+02:00 Brett Swann <brettswann at gmail.com>:

> Hi Florent,
>
> A random BD_ADDR is "okay" for testing, but just be aware of the
> requirement for an OUI as discussed in BLE Core specification, volume 2,
> section 1.2 [1]. Also, steer clear of the reserved range mentioned in
> section 1.2.1.
>
> Kind regards,
> Brett
>
> [1]
> https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737
>
>
> On Wed, Jun 15, 2016 at 3:27 PM Martine Lenders <mail at martine-lenders.eu>
> wrote:
>
>> Hi,
>> alternatively, instead of truncating you can just "fold" the remaining
>> bytes over using XOR this way you keep some of the variance introduced
>> by the longer hash.
>>
>> Best regards,
>> Martine
>>
>> 2016-06-15 15:12 GMT+02:00 Jose Alamos <jialamos at uc.cl>:
>> > Hello,
>> >
>> > I don't know exactly how the BD_ADDR works, but you might try generate a
>> > hash (maybe SHA256? [1]) from CPU ID (function cpuid_get [2]).
>> >
>> > Then you can truncate to 48 bits and manually set/fix required bytes. Of
>> > course the truncation makes the hash weaker in terms of the chances of
>> > having 2 same BD_ADDR, but I think that's very unlikely.
>> >
>> > Best regards.
>> >
>> >
>> > [1] http://riot-os.org/api/sha256_8h.html
>> > [2]
>> >
>> http://riot-os.org/api/group__drivers__periph__cpuid.html#ga562e64bc300b062ac82dac98b8af7cf2
>> >
>> > _______________________________________________
>> > devel mailing list
>> > devel at riot-os.org
>> > https://lists.riot-os.org/mailman/listinfo/devel
>> >
>> _______________________________________________
>> devel mailing list
>> devel at riot-os.org
>> https://lists.riot-os.org/mailman/listinfo/devel
>>
>
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20160615/e37c6e01/attachment-0001.html>


More information about the devel mailing list